V8: Add auto-focus to the default action in overlay dialogs #5463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
This one may be a bit controversial... but here goes 😄
There are a few issues with using keyboard input (tabbing and enter) around in overlay dialogs:
This PR introduces an option to set auto-focus on
umb-button
, and utilizes said option on the default action in the overlay dialogs. This means that the default action always has immediate focus, and thus will be invoked when you hit enter (unless you tab away).The controversial bit of this PR is actually two fold:
The default action button is highlighted (because it has focus). Personally I think it makes sense; now you can actually decode what's going to happen if you hit enter (even if the highlight color is a bit vague... fixing that is part of the accessibility initiative if I'm not mistaken).
Since the default action has focus, you need to shift+tab to access the other actions (as you need to go backwards in tab order). The upside is that you actually can use the other actions now.