A11Y: Fix tab order in "Feature topic" modal (#18576)

Tab order acts strangely in Chrome when the last focusable element in a
modal is a radio group: it switches focus to the address bar. This is a
problem, because for keyboard users, it becomes very hard to return to
the previous context.

This PR adds a focusable "Cancel" button, whose mere presence fixes the
issue.
This commit is contained in:
Penar Musaraj 2022-10-13 16:15:45 -04:00 committed by GitHub
parent e0a6d12c55
commit 74a6a868d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,7 @@
{{#if this.noResults}}
<p>{{i18n "choose_topic.none_found"}}</p>
{{else}}
<div class="choose-topic-list">
<div class="choose-topic-list" role="radiogroup">
{{#each this.topics as |t|}}
<div class="controls existing-topic">
<label class="radio">

View File

@ -4,4 +4,5 @@
<div class="modal-footer">
<DButton @action={{action "save"}} @class="btn-primary save-featured-topic-on-profile" @disabled={{this.noTopicSelected}} @label="user.feature_topic_on_profile.save" />
<DButton @action={{route-action "closeModal" }} @label="cancel" @class="btn-flat" />
</div>