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

Should Confirmation Modals have cancel or confirm focused by default? #10040

Closed
cjcenizal opened this issue Jan 24, 2017 · 8 comments
Closed
Labels
Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins.

Comments

@cjcenizal
Copy link
Contributor

Per #9984 (comment) let's explore whether it's better to autofocus the cancel or confirm options when opening a Confirmation Modal.

Reasons to focus Cancel

It's the safe option. Since the Modal is there to prevent an irreversible action from being taken by accident, we should require explicit confirmation.

Reasons to focus Confirm

This is the way native browser confirmation modals behave.

@cjcenizal cjcenizal added Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. discuss labels Jan 24, 2017
@cjcenizal cjcenizal changed the title Should Confirmation Modals have cancel of confirm focused by default? Should Confirmation Modals have cancel or confirm focused by default? Jan 24, 2017
@stacey-gammon
Copy link
Contributor

Perhaps another reason to focus confirm is that it was most likely the users intention, and defaulting the focus to confirm reduces the number of actions required for it to take place.

@jimgoodwin
Copy link

Default will be cancel for destructive actions
Styling is the same, just has focus
Figure out how to make Spencer happy with how it looks

@uboness
Copy link

uboness commented Jan 30, 2017

Default will be cancel for destructive actions

++

@w33ble
Copy link
Contributor

w33ble commented Jan 30, 2017

To clarify, the default focus will be cancel, so by default hitting enter will be the same as clicking cancel.

But this should be configurable, so that Enter can be made to confirm by default, and the intention is that its use is limited to non-destructive actions.

@uboness
Copy link

uboness commented Jan 30, 2017

Why have a default at all? Why not force to explicitly state what the default is? We want ppl to pay attention to these small yet important details. It it's explicit and someone gets it wrong we can pick it up in code review (with a side effect of spreading the knowledge as well)

@cjcenizal
Copy link
Contributor Author

cjcenizal commented Jan 30, 2017

What @uboness is describing is what I had originally in mind, but I can see how the term "default" could have been interpreted to mean a default setting in the implementation.

From a design perspective, we should err on the side of caution and explicitly set the default focus to be on the non-destructive option. If we decide that we can help the user complete an action more quickly by changing the default to be another option, e.g. a constructive action such as "Submit", then we can explicitly set the default focus to that option.

I think Uri's points are on the mark, and we should avoid a default in the implementation, and instead require engineers to specify which option gains focus by default.

@w33ble
Copy link
Contributor

w33ble commented Jan 31, 2017

No default is fine too, as long as it's configurable. Having a default means a little less typing, but as you point out, at the cost of being explicit.

@cjcenizal
Copy link
Contributor Author

Addressed in EUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins.
Projects
None yet
Development

No branches or pull requests

5 participants