Skip to content

Commit

Permalink
Prevent tree changes when changing enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberpwnn committed Nov 8, 2024
1 parent 1a631b8 commit 89cd69f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/src/components/menu/context_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -453,22 +453,22 @@ class _ContextMenuState extends State<ContextMenu> {
final bool enableLongPress = platform == TargetPlatform.iOS ||
platform == TargetPlatform.android ||
platform == TargetPlatform.fuchsia;
return widget.enabled
? GestureDetector(
behavior: widget.behavior,
onSecondaryTapDown: (details) {
return GestureDetector(
behavior: widget.behavior,
onSecondaryTapDown: !widget.enabled
? null
: (details) {
_showContextMenu(
context, details.globalPosition, _children, widget.direction);
},
onLongPressStart: enableLongPress
? (details) {
_showContextMenu(context, details.globalPosition, _children,
widget.direction);
}
: null,
child: widget.child,
)
: widget.child;
onLongPressStart: enableLongPress && widget.enabled
? (details) {
_showContextMenu(
context, details.globalPosition, _children, widget.direction);
}
: null,
child: widget.child,
);
}
}

Expand Down

0 comments on commit 89cd69f

Please sign in to comment.