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

Focus on confirm in ConfirmationModal #945

Closed
huwshimi opened this issue Jul 17, 2023 · 2 comments
Closed

Focus on confirm in ConfirmationModal #945

huwshimi opened this issue Jul 17, 2023 · 2 comments

Comments

@huwshimi
Copy link
Collaborator

It would be nice if there was a way to set the focus on the confirm button when opening the modal so that users can press enter to confirm.

This should probably only happen if the confirm is positive (maybe it should focus on cancel if the action is negative). Here's how we do something similar in Juju Dashboard (though it only happens for "neutral" actions): https://github.com/canonical/juju-dashboard/blob/main/src/components/ConfirmationModal/ConfirmationModal.tsx#L23.

@bartaz
Copy link
Member

bartaz commented Nov 28, 2023

As discussed in the PR from accessibility point of view if the action is destructible (or at least hard to revert) modal should not focus on the action button, but rather cancel/close (which happens right now I believe).

Confirmation modal by definition is meant to be used to confirm actions that may have irreversible consequences.

If action is neutral, or easy to undo, why have confirmation modal at all? Can't it be triggered immediately (instead of opening the modal)?

@bartaz
Copy link
Member

bartaz commented Sep 30, 2024

Triage: closing this for now, as it doesn't seem to be needed as requested.

If we want to consider it as a feature, this likely needs to be raised with UX.

@bartaz bartaz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
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 a pull request may close this issue.

2 participants