mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-18 13:45:12 +02:00
Further aria roles
This commit is contained in:
parent
ba659351a6
commit
fd8b594568
4
assets/scripts/dist/choices.min.js
vendored
4
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1546,14 +1546,14 @@ export class Choices {
|
|||
item: (data) => {
|
||||
if(this.config.removeItemButton && this.passedElement.type !== 'select-one') {
|
||||
return strToEl(`
|
||||
<div class="${ classNames.item } ${ data.highlighted ? classNames.highlightedState : ''} ${ !data.disabled ? classNames.itemSelectable : '' }" data-item data-id="${ data.id }" data-value="${ data.value }" data-deletable>
|
||||
<div class="${ classNames.item } ${ data.highlighted ? classNames.highlightedState : ''} ${ !data.disabled ? classNames.itemSelectable : '' }" data-item data-id="${ data.id }" data-value="${ data.value }" ${ data.active ? 'aria-selected="true"' : '' } ${ data.disabled ? 'aria-disabled="true"' : '' } data-deletable>
|
||||
${ data.label }
|
||||
<button class="${ classNames.button }" data-button>Remove item</button>
|
||||
</div>
|
||||
`);
|
||||
} else {
|
||||
return strToEl(`
|
||||
<div class="${ classNames.item } ${ data.highlighted ? classNames.highlightedState : classNames.itemSelectable }" data-item data-id="${ data.id }" data-value="${ data.value }">
|
||||
<div class="${ classNames.item } ${ data.highlighted ? classNames.highlightedState : classNames.itemSelectable }" data-item data-id="${ data.id }" data-value="${ data.value }" ${ data.active ? 'aria-selected="true"' : '' } ${ data.disabled ? 'aria-disabled="true"' : '' }>
|
||||
${ data.label }
|
||||
</div>
|
||||
`);
|
||||
|
@ -1561,7 +1561,7 @@ export class Choices {
|
|||
},
|
||||
choiceList: () => {
|
||||
return strToEl(`
|
||||
<div class="${ classNames.list }" dir="ltr"></div>
|
||||
<div class="${ classNames.list }" dir="ltr" role="listbox" ${ this.passedElement.type !== 'select-one' ? 'aria-multiselectable="true"' : ''}></div>
|
||||
`);
|
||||
},
|
||||
choiceGroup: (data) => {
|
||||
|
@ -1580,7 +1580,7 @@ export class Choices {
|
|||
},
|
||||
input: () => {
|
||||
return strToEl(`
|
||||
<input type="text" class="${ classNames.input } ${ classNames.inputCloned }" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox">
|
||||
<input type="text" class="${ classNames.input } ${ classNames.inputCloned }" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list">
|
||||
`);
|
||||
},
|
||||
dropdown: () => {
|
||||
|
|
Loading…
Reference in a new issue