[material-ui][Dialog] Should not close until the IME is cancelled#39713
Merged
mj12albert merged 1 commit intomui:masterfrom Nov 6, 2023
Merged
[material-ui][Dialog] Should not close until the IME is cancelled#39713mj12albert merged 1 commit intomui:masterfrom
mj12albert merged 1 commit intomui:masterfrom
Conversation
Netlify deploy previewhttps://deploy-preview-39713--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
DiegoAndai
reviewed
Nov 3, 2023
Member
DiegoAndai
left a comment
There was a problem hiding this comment.
Hey @megos, thanks for working on this 🎉
I left a question:
| if (event.key !== 'Escape' || !isTopModal()) { | ||
| if ( | ||
| event.key !== 'Escape' || | ||
| event.which === 229 || // Wait until IME is settled. |
Member
There was a problem hiding this comment.
.which is deprecated. Could we use .isComposing instead?
Member
There was a problem hiding this comment.
FYI I found in an old issue about isComposing with an odd behavior in macOS Safari: #19435 (comment)
Contributor
Author
There was a problem hiding this comment.
As per the issue comment above, it needs to use which instead of isComposing for Safari.
This behavior is not fixed on the latest (17.1) Safari version.
mj12albert
approved these changes
Nov 6, 2023
Member
mj12albert
left a comment
There was a problem hiding this comment.
Looks good ~ appreciate that you added a test as well ✨ @megos
This was referenced Oct 1, 2024
| fireEvent.keyDown(textbox, { key: 'Esc', keyCode: 229 }); | ||
| expect(onClose.callCount).to.equal(0); | ||
|
|
||
| fireEvent.keyDown(textbox, { key: 'Esc' }); |
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.
We use the escape key to cancel IME input.
This PR changed a dialog that keeps open when you cancel IME input in a dialog with the escape key.
This is similar to #19435