mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
A11Y: makes select-kit header a listbox (#12078)
Note that for now pressing enter doesn’t make anything, this is awaiting another change.
This commit is contained in:
parent
85c4e8fd32
commit
323a5f22e7
@ -28,7 +28,7 @@ export default Component.extend(UtilsMixin, {
|
|||||||
"ariaOwns:aria-owns",
|
"ariaOwns:aria-owns",
|
||||||
"ariaHasPopup:aria-haspopup",
|
"ariaHasPopup:aria-haspopup",
|
||||||
"ariaIsExpanded:aria-expanded",
|
"ariaIsExpanded:aria-expanded",
|
||||||
"roleButton:role",
|
"headerRole:role",
|
||||||
"selectedValue:data-value",
|
"selectedValue:data-value",
|
||||||
"selectedNames:data-name",
|
"selectedNames:data-name",
|
||||||
"buttonTitle:title",
|
"buttonTitle:title",
|
||||||
@ -72,7 +72,7 @@ export default Component.extend(UtilsMixin, {
|
|||||||
return `${this.selectKit.uniqueID}-body`;
|
return `${this.selectKit.uniqueID}-body`;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
roleButton: "button",
|
headerRole: "listbox",
|
||||||
|
|
||||||
tabindex: 0,
|
tabindex: 0,
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{#if selectKit.options.showFullTitle}}
|
{{#if selectKit.options.showFullTitle}}
|
||||||
<div role="button" lang={{lang}} {{action "onSelectedNameClick"}} title={{title}} data-value={{value}} data-name={{name}} class="select-kit-selected-name selected-name choice">
|
<div tabindex="0" role="button" lang={{lang}} {{action "onSelectedNameClick"}} title={{title}} data-value={{value}} data-name={{name}} class="select-kit-selected-name selected-name choice">
|
||||||
{{#if item.icon}}
|
{{#if item.icon}}
|
||||||
{{d-icon item.icon}}
|
{{d-icon item.icon}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -72,6 +72,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
|
&:focus .d-icon-times {
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
.d-icon + .name {
|
.d-icon + .name {
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user