CommandPalette: Fixed to not execute commands in IME composition.#52844
Merged
CommandPalette: Fixed to not execute commands in IME composition.#52844
Conversation
|
Size Change: +34 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
Member
Author
|
@mirka we need a Mac and an IME to test this issue. Can you test it for me? |
mirka
approved these changes
Jul 24, 2023
Member
mirka
left a comment
There was a problem hiding this comment.
Works well for me, and we've already discussed and implemented this approach in some wp-components as well 👍
Reproduced and confirmed fixed on Mac Safari and Mac Chrome. (Doesn't repro in Mac Firefox, as noted in the original issue.)
Contributor
|
I think this PR will solve an important problem in languages that use IMEs, so I will give it a backport label. |
Member
|
I just cherry-picked this PR to the update/packages-wp-6-3-RC3 branch to get it included in the next release: 8142681 |
ramonjd
added a commit
that referenced
this pull request
Jul 28, 2023
* Patterns: Enable focus mode editing (#52427) * PreventDefault when isComposing is true. apply patch from t-hamano. (#52844) see: #52821 (comment) * List View: Ensure onDrop does not fire if there is no target (#52959) * I18N: Add missing Gettext wrapper on strings in Edit Post overview sidebar (#52971) * I18N: Add missing gettext wrapper * Add context to disambiguate 'Outline' that is commonly used on borders. * Footnotes: disable based on post type (#52934) * Footnotes: disable based on post type * Address feedback * Fix typo * Format: disable if block is not registered * Lock usesContext api * Use Symbol instead of Math.random * Patterns Browse Screen: Fix back button when switching between categories (#52964) * Patterns: Allow orphaned template parts to appear in general category (#52961) * Spacing presets: fix bug with select control adding undefined preset values (#53005) * Site Editor: Fix canvas mode sync with URL (#52996) * Check if spacing tool is defined before displaying controls. (#53008) * Check if spacing tool is defined before displaying controls. * Don't show sides if spacing type false * Improve consistency of the Post editor and Site editor Document actions (#52246) * Remove redundant shortcut button. * Fix focus and hover style and improve consistency. * Rename post document-title and improve CSS consistency. * Site Editor: Fix the typo in the title label map (#53071) * Fix patterns search crash: check for existence of defaultView before attempting to get styles (#52956) * backport paging bug fixes (#53091) --------- Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Hiroshi Urabe <mail@torounit.com> Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: Pedro Mendonça <ped.gaspar@gmail.com> Co-authored-by: Ella <4710635+ellatrix@users.noreply.github.com> Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Glen Davies <glendaviesnz@users.noreply.github.com> Co-authored-by: tellthemachines <tellthemachines@users.noreply.github.com> Co-authored-by: Andrea Fercia <a.fercia@gmail.com>
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.
What?
Similar to 45607, if
isComposingistruewhen Enter is pressed, the event was prevented.Apply patch from @t-hamano
#52821 (comment)
Why?
fix: #52821
How?
Use cmdk props.onKeydown to execute event.preventDefault() when Enter is pressed. cmdk will not execute anything on keyDown if event.defaultPrevented is true.
https://github.com/pacocoursey/cmdk/blob/ba2e20035ad86a2cb0fae0c2c296796e48a0181c/cmdk/src/index.tsx#L515
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast