Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Dialog] Should not close until the IME is cancelled #39713

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

megos
Copy link
Contributor

@megos megos commented Nov 2, 2023

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

@mui-bot
Copy link

mui-bot commented Nov 2, 2023

Netlify deploy preview

https://deploy-preview-39713--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 22e5a42

@mj12albert mj12albert added component: dialog This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Nov 2, 2023
@mj12albert mj12albert requested review from DiegoAndai and siriwatknp and removed request for mnajdova November 2, 2023 08:11
Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

@DiegoAndai DiegoAndai Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.which is deprecated. Could we use .isComposing instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I found in an old issue about isComposing with an odd behavior in macOS Safari: #19435 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mj12albert self-assigned this Nov 6, 2023
Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ~ appreciate that you added a test as well ✨ @megos

@mj12albert mj12albert merged commit c3d6309 into mui:master Nov 6, 2023
21 of 22 checks passed
@mj12albert mj12albert added the bug 🐛 Something doesn't work label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: dialog This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants