Repository navigation
feat(suggestion-menu): add the keymap and dismissal - #532
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kianbazza
added this pull request to stack #526
September 29, 2026 01:44
kianbazza
force-pushed
the
ui-561-add-the-suggestion-menu-keymap-and-dismissal
branch
from
September 29, 2026 14:29
f370507 to
ef1848b
Compare
kianbazza
marked this pull request as ready for review
September 29, 2026 14:45
This branch was successfully deployed
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.
Summary
SuggestionMenuhandles the keyboard from the host input, and closes when the user leaves it.The host passes key presses to
handle.handleKeyDown(event), which returnstruewhen the menu used the key. That matches how ProseMirror, CodeMirror and Lexical order their keymaps.Dismissal:
item-presseven when the row'sonSelectedits the text and the editor closes the menu from there. A close requested during Enter, or during a click on a row, waits until the menu's own close.Evidence
suggestion-menu.keymap.test.tsx(22 tests):documentlistener, with keys forwarded from a native listener.item-pressonce from a contenteditable host. A row that keeps the menu open still applies its ownclose().Checked in Chromium with ProseMirror:
item-pressonce. Browsers run microtasks between event listeners, which jsdom doesn't reproduce, so this needed a real browser.escape-key, and clicking elsewhere reportsoutside-press.Merge Danger
Door: two-way
Blast Radius: SuggestionMenu only
Closes UI-561