Closed huwshimi closed 1 month ago
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)?
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.
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.