-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Consider replacing usages of Window.confirm() with Modal #16583
Comments
Do we currently use modals as a stand-in for standard alerts elsewhere? I do find modals like the one pictured to be a little less alarming than the standard browser one, but I'm definitely be curious about any a11y considerations for this. |
This is technically impossible to implement, at least for the confirmations shown on |
@aduth: None of the |
You're totally right! I skimmed the text of the last screenshot and the "result in content loss" had me jump the gun on assuming that's what we were discussing. For the ones which don't involve navigation, it's totally possible to re-style. I guess it's worth clarifying at least that it cannot be applied for the prompt which asks the user to confirm unsaved changes before navigating away or refreshing a "dirty" post. |
I searched the entire project for this issue with the keyword gutenberg/packages/editor/src/components/template-validation-notice/index.js Lines 18 to 22 in 0f689f9
|
We're currently using
Window.confirm()
in four places. This isn't an ideal experience as we're unable to customise the OK button to have a more descriptive label.Moving these instances to use a
Modal
component might provide a better experience. Here's an example of aModal
being used this way, from @kjellr's mockup in #16315 (comment):1. Switching a published post to draft
Current:
Proposed:
2. Switching a published post to private
Current:
Proposed:
3. Deleting a reusable block
Current:
Proposed:
4. Pressing Reset the template when template doesn't match post content
Current:
Proposed:
The text was updated successfully, but these errors were encountered: