You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Autofocus confirmation dialogs (like "Convert to draft") #9247
GitHub has a few of these custom dialogs that fail the most basic of UX rules for modals: you can't accept them by pressing space/enter.
The solution would be simple:
detect modal opening
auto-focus "accept" button
The feature would be in the same vein as no-modals and same-page-links, where we improve accessibility and UX by making things work as well as their native counterparts.
The dialog displayed in #9200 for example works correctly, the "Keep editing" button is focused, meaning you can press tab, enter to continue. I think it's the wrong button selected, but alas changing it would cause issues here.
This one doesn't have a primary button at all. I guess we have to check if there is a primary button first and, if not, select the one whose variant isn't the default?*
* It is possible that all buttons are default variants. Then we have to select one whose variant isn't invisible
Hi! I'm interested in working on this issue as my first contribution to Refined GitHub.
I noticed that GitHub has since added autofocus to some dialogs. Is this feature still needed for the remaining dialogs, or has GitHub addressed most of the cases?
I'd be happy to take this on if it's still relevant. Thanks!
Activity
fregante commentedon Apr 23, 2026
The dialog displayed in #9200 for example works correctly, the "Keep editing" button is focused, meaning you can press
tab, enterto continue. I think it's the wrong button selected, but alas changing it would cause issues here.fregante commentedon Apr 30, 2026
Another one: https://github.com/refined-github/refined-github/actions/runs/25168558707/job/73781235520?pr=9294
fregante commentedon May 19, 2026
Another one:
fregante commentedon May 20, 2026
Another one: https://github.com/refined-github/refined-github/actions
fregante commentedon May 20, 2026
Note how they ALL use a different component 😭
SunsetTechuila commentedon May 20, 2026
Is this a big problem? Can we watch for
:is(dialog, div[role="dialog"]) primary-button-selector?SunsetTechuila commentedon May 20, 2026
I expect this to be a bigger problem. We have:
btn)Button)prc-Button)prc-Button-gibberish)And sometimes there might be just one button, which can be non-primary
SunsetTechuila commentedon May 20, 2026
This one doesn't have a primary button at all. I guess we have to check if there is a primary button first and, if not, select the one whose variant isn't the
default?** It is possible that all buttons are
defaultvariants. Then we have to select one whose variant isn'tinvisiblefregante commentedon May 20, 2026
Yeah, that's the problem, there's no standard anywhere.
The primary action would be:
So far we don't have any forms that have both red and green buttons.
I think something like
button.danger, button.primarywould work, but we don't have those easy classes.fregante commentedon Jun 16, 2026
We have GitHubbers reading our issue probably 🙂 the modal in title is now auto-focused and pressing
Enterwill confirm itvolantine commentedon Oct 29, 2026
Hi! I'm interested in working on this issue as my first contribution to Refined GitHub.
I noticed that GitHub has since added autofocus to some dialogs. Is this feature still needed for the remaining dialogs, or has GitHub addressed most of the cases?
I'd be happy to take this on if it's still relevant. Thanks!