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

Handle Chrome double escape behaviour #4396

Merged
merged 1 commit into from
Dec 8, 2024
Merged

Conversation

nicodh
Copy link
Member

@nicodh nicodh commented Dec 8, 2024

resolves #4365

Pressing escape key twice will close open dialogs in Chrome no matter how onCancel is configured https://issues.chromium.org/issues/346597066

To handle that we move the onClickBackButton function one component higher to add it as onClose prop to the Dialog and handle the event the same way a BackButton Click would be handled

TODO: check other dialogs how the behave on forced close (should go into a new Issue though)

resolves #4365

Pressing escape key twice will close open dialogs in Chrome no matter
how onCancel is configured https://issues.chromium.org/issues/346597066

To handle that we move the onClickBackButton function one component
higher to add it as onClose prop to the Dialog and handle the event
the same way a BackButton Click would be handled
@nicodh
Copy link
Member Author

nicodh commented Dec 8, 2024

Also tested with Instant Onboarding (closing the dialog when in profile creation process. (The rebuilded dialog looses the contactName but works after entering a profile name, so I left it as rare edge case)

@nicodh nicodh requested review from WofWca and maxphilippov December 8, 2024 09:35
@WofWca
Copy link
Collaborator

WofWca commented Dec 8, 2024

Does this MR handle all the canEscapeKeyClose={false} occurences?

And shouldn't we remove / rename that prop?

@nicodh
Copy link
Member Author

nicodh commented Dec 8, 2024

Does this MR handle all the canEscapeKeyClose={false} occurences?

No it doesn't (as mentioned in the MR description)

should we rename the property

I would not, since once we have other browser with tauri they hopefully behave as expected

Copy link
Collaborator

@WofWca WofWca left a comment

Choose a reason for hiding this comment

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

OK, this improves things. I tested it with both no accounts and with other accounts present.

But I'd say we should keep that issue open, to handle other such dialogs, and to perhaps find a more thorough approach.

Because canEscapeKeyClose doesn't actually do what it advertises. So looks like we ought to always handle onClose or onCancel on all dialogs. But let's keep further discussions in #4365, or a follow-up issue, I suppose.

@nicodh nicodh merged commit f507eee into main Dec 8, 2024
11 checks passed
@nicodh nicodh deleted the fix-4365-handle-dialog-esc branch December 8, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cancelling profile creation with "Esc" not fully working
2 participants