mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-29 10:50:03 +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) => {
|
item: (data) => {
|
||||||
if(this.config.removeItemButton && this.passedElement.type !== 'select-one') {
|
if(this.config.removeItemButton && this.passedElement.type !== 'select-one') {
|
||||||
return strToEl(`
|
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 }
|
${ data.label }
|
||||||
<button class="${ classNames.button }" data-button>Remove item</button>
|
<button class="${ classNames.button }" data-button>Remove item</button>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
} else {
|
} else {
|
||||||
return strToEl(`
|
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 }
|
${ data.label }
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
@ -1561,7 +1561,7 @@ export class Choices {
|
||||||
},
|
},
|
||||||
choiceList: () => {
|
choiceList: () => {
|
||||||
return strToEl(`
|
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) => {
|
choiceGroup: (data) => {
|
||||||
|
@ -1580,7 +1580,7 @@ export class Choices {
|
||||||
},
|
},
|
||||||
input: () => {
|
input: () => {
|
||||||
return strToEl(`
|
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: () => {
|
dropdown: () => {
|
||||||
|
|
Loading…
Reference in a new issue