fix: close toolbar dropdowns when clicking in editor area#2170
fix: close toolbar dropdowns when clicking in editor area#2170gpardhivvarma wants to merge 1 commit intosuperdoc-dev:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b821d4334b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
b821d43 to
e0050df
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0050df866
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
EditorInputManager calls preventDefault() on pointerdown in the editor viewport, which suppresses mousedown/click events per the Pointer Events spec. Since Naive UI's NDropdown uses mousedown for click-outside detection, dropdowns remain open when clicking back into the editor. Add a pointerdown-based click-outside listener in ButtonGroup.vue that closes open dropdowns when clicking outside the toolbar UI surface. pointerdown always fires regardless of preventDefault() calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e0050df to
b0e6bd2
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
hey @gpardhivvarma - thanks for the PR and especially the root cause analysis, nailing it down to closing this one in favor of #2174 (since both PRs solve the same problem and there's significant overlap), but really appreciate you jumping in on this. if you're interested in contributing more, feel free to check out our open issues especially the ones with good first issue label |
|
Thank you . I will surely check out some good first issues. I am fairly new to open source , just started with this because it's an issue we are facing in our org using super doc. |
Summary
Fixes #2169
EditorInputManagercallspreventDefault()onpointerdownin the editor viewport, which suppressesmousedown/clickper the Pointer Events spec. Naive UI'sNDropdownrelies onmousedownfor click-outside detection, so it never sees the click.pointerdown-based click-outside listener inButtonGroup.vuethat closes open dropdowns when clicking outside the toolbar UI surface.pointerdownalways fires regardless ofpreventDefault()calls.Test plan