fix(mobile): make interactive content inside nodes work under touch#1
Open
JibayMcs wants to merge 2 commits into
Open
fix(mobile): make interactive content inside nodes work under touch#1JibayMcs wants to merge 2 commits into
JibayMcs wants to merge 2 commits into
Conversation
added 2 commits
June 6, 2026 01:47
Builds on this PR's mobile node drag. For a node whose custom widget embeds interactive content (a scrollable, text fields), on touch/Android: - scrolling a ListView inside a node no longer drags the node; - long-press / selecting text in a TextField inside a node now works (the InteractiveViewer's always-present ScaleGestureRecognizer no longer steals the long-press, and a tap no longer steals focus from the field). Changes: lib/src/editor/element_scope.dart (skip touch node-drag capture over a scrollable or editable child), node_flow_editor.dart (swap InteractiveViewer for a plain Transform while editing so descendant gestures win; focus-aware) and node_flow_editor_hit_testing.dart (don't steal canvas focus on a tap while a field is focused).
The canvas swaps the InteractiveViewer for a plain Transform while the canvas is locked or a node's text field is focused. The whole canvas is built inside a LayoutBuilder, which owns a build scope flushed during layout, so the swap reparents the GlobalKey canvas content inside the layout pass. When a mouse-hover Tooltip OverlayPortal is active, reactivating it mid-layout throws "_RenderLayoutBuilder was mutated in performLayout" — crashing on desktop (never on touch, which has no hover). The swap is a touch-only workaround (long-press text selection plus keeping the keyboard up). Gate it to touch platforms so desktop keeps the InteractiveViewer with pan/zoom gated by the lock state — no reparent, no crash. The touch swap is also now driven by a mobx observable instead of setState, with keyboard visibility cached in didChangeDependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on this PR's mobile node drag. For a node whose custom widget embeds interactive content (a scrollable, text fields), on touch/Android:
Changes: lib/src/editor/element_scope.dart (skip touch node-drag capture over a scrollable or editable child), node_flow_editor.dart (swap InteractiveViewer for a plain Transform while editing so descendant gestures win; focus-aware) and node_flow_editor_hit_testing.dart (don't steal canvas focus on a tap while a field is focused).