Skip to content

Commit

Permalink
Correct use of aria-selected in FT
Browse files Browse the repository at this point in the history
Note: was able to add aria-controls to ft-profile-selector because it keeps the hidden dropdown in the DOM. The same is not true of the ft-icon-button or ft-subscribe-button. Main point: aria-expanded should go on the button opening the dropdown, not the dropdown itself.
  • Loading branch information
kommunarr committed Oct 27, 2023
1 parent 002ffde commit fffecfe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/renderer/components/ft-icon-button/ft-icon-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
}"
tabindex="0"
role="button"
:aria-expanded="dropdownShown"
@click="handleIconClick"
@mousedown="handleIconMouseDown"
@keydown.enter.prevent="handleIconClick"
Expand All @@ -33,7 +34,6 @@
v-if="dropdownOptions.length > 0"
class="list"
role="listbox"
:aria-expanded="dropdownShown"
>
<li
v-for="(option, index) in dropdownOptions"
Expand Down Expand Up @@ -71,7 +71,6 @@
v-if="dropdownOptions.length > 0"
class="list"
role="listbox"
:aria-expanded="dropdownShown"
>
<li
v-for="(option, index) in dropdownOptions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
:style="{ background: activeProfile.bgColor, color: activeProfile.textColor }"
tabindex="0"
role="button"
:aria-expanded="profileListShown"
aria-controls="profileSelectorList"
@click="toggleProfileList"
@mousedown="handleIconMouseDown"
@keydown.space.prevent="toggleProfileList"
Expand All @@ -19,6 +21,7 @@
</div>
<ft-card
v-show="profileListShown"
id="profileSelectorList"
ref="profileList"
class="profileList"
tabindex="-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
box-shadow: 0px 1px 2px rgb(0 0 0 / 50%);
display: flex;
flex-wrap: nowrap;
/* addresses odd clipping behavior when adjusting window size*/
/* addresses odd clipping behavior when adjusting window size */
background-color: var(--primary-color);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
class="profileDropdownToggle"
background-color="var(--primary-color)"
text-color="var(--text-with-main-color)"
:aria-expanded="isProfileDropdownOpen"
@click="toggleProfileDropdown"
>
<font-awesome-icon
Expand All @@ -38,17 +39,14 @@
>
<ul
class="profileList"
:aria-expanded="isProfileDropdownOpen"
>
<!-- may want to make role="checkbox" -->
<li
v-for="(profile, index) in profileDisplayList"
:id="'profile-' + index"
:key="'subscription-profile-' + index"
class="profile"
:class="{
subscribed: isProfileSubscribed(profile),
unsubscribed: !isProfileSubscribed(profile)
subscribed: isProfileSubscribed(profile)
}"
:aria-labelledby="'profile-' + index + '-name'"
:aria-selected="isActiveProfile(profile)"
Expand Down

0 comments on commit fffecfe

Please sign in to comment.