A workaround for the space issue in key-value editor [INS-5274]#8627
Merged
A workaround for the space issue in key-value editor [INS-5274]#8627
Conversation
e994b57 to
507aebc
Compare
Contributor
|
@gatzjames has expertise on key press handling in insomnia. I'll add him to reviewers, thanks @yaoweiprc |
gatzjames
approved these changes
Apr 23, 2025
Contributor
gatzjames
left a comment
There was a problem hiding this comment.
Great work!
Looks like a sensible solution to me until there's a better way to handle propagation in react-aria
507aebc to
32fed3c
Compare
cwangsmv
pushed a commit
that referenced
this pull request
Apr 25, 2025
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.
Close #8091
When the user presses a letter key and then immediately presses the space bar.
The keydown event for the space key was stopped from propagating during the capture phase by the ListBox component
That is why the inner editor fails to respond to the immediate space press behavior.
Here we add a wrapper to the outer ListBox and add a wrapper to the inner editor and listen to the keydown event in both wrappers.
When the user presses the space key, we change the event.key property with non-breakable space in the outer wrapper and change it back in the inner wrapper.