Repository navigation
Fix quick-add dialog moving instead of closing when clicking the workspace - #6027
Merged
knolleary merged 1 commit intoOct 21, 2026
Merged
Conversation
|
|
Member
|
/easycla |
Member
|
I see you have signed the CLA from PR #6026 - but this PR has not refreshed to show that. Can you push an empty commit to your branch to force the EasyCLA bot to recheck? The /easycla command should have triggered it, but that hasn't happened. |
NUAAwqy
pushed a commit
to NUAAwqy/node-red
that referenced
this pull request
Oct 21, 2026
Signed-off-by: NUAAwqy <[email protected]>
NUAAwqy
force-pushed
the
fix-quick-add-context-menu-reopen
branch
from
October 21, 2026 09:29
01736a8 to
7906a91
Compare
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.
Types of changes
Proposed changes
Fixes #5783 - quick-add dialog "moves" to every workspace click instead of closing when it was opened from the context menu (Insert > Node).
As @knolleary suspected, it is an event-handler ordering issue: the context-menu path leaves
mouse_mode === RED.state.QUICK_JOININGset, so the workspacemousedownhandler inview.jsre-invokesshowQuickAddDialogon each click. The element-level d3 handler runs before the document-leveltypeSearchhandler, andtypeSearch.show()calls$(document).off('mousedown.red-ui-type-search')before the current event can bubble - sohandleMouseActivitynever runs, the cancel callback never fires, and the dialog just repositions. The cmd/ctrl path avoids this because the keyup handler clears QUICK_JOINING before the next click arrives.The fix is one line: guard the QUICK_JOINING branch with
RED.typeSearch.isVisible()(the same accessorview.jsalready uses at the keyboard-handling site). While the dialog is visible the click bubbles normally, closing the dialog and running the cancel callback. The keep-adding behavior (clicking the canvas to reopen the dialog after inserting a node) is preserved because the dialog is hidden between additions, soisVisible()is false.Checklist
This interaction path has no automated test coverage in the repo; verification was
node --checkon the edited file plus tracing both flows (context-menu open -> click closes; cmd/ctrl open -> unchanged; keep-adding reopen -> unchanged). I can extend a jsdom-based editor test if maintainers want one for this.AI disclosure: this change was drafted with assistance from an AI coding agent, reviewed by the author, and verified as described above.