feat(Picker): improve accessibility (#4521)

This commit is contained in:
neverland
2019-09-21 07:26:58 +08:00
committed by GitHub
parent 3c210f8252
commit a1ac34bead
11 changed files with 690 additions and 760 deletions
+7 -1
View File
@@ -237,12 +237,18 @@ export default createComponent({
return this.options.map((option, index) => {
const text = this.getOptionText(option);
const disabled = isOptionDisabled(option);
const data = {
style: optionStyle,
attrs: {
role: 'button',
tabindex: disabled ? -1 : 0
},
class: [
'van-ellipsis',
bem('item', {
disabled: isOptionDisabled(option),
disabled,
selected: index === this.currentIndex
})
],