Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Feb 14, 2024
1 parent 84d3e7f commit 973630e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/lib/selectbutton/SelectButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
v-for="(option, i) of options"
:key="getOptionRenderKey(option)"
v-ripple
:tabindex="disabled || isOptionDisabled(option) || i !== focusedIndex ? '-1' : '0'"
:tabindex="findTabindex(option, i)"
:aria-label="getOptionLabel(option)"
:role="multiple ? 'checkbox' : 'radio'"
:aria-checked="isSelected(option)"
Expand Down Expand Up @@ -198,6 +198,9 @@ export default {
}
this.$emit('blur', event, option);
},
findTabindex(option, index) {
return this.disabled || this.isOptionDisabled(option) || index !== this.focusedIndex ? '-1' : '0';
}
},
computed: {
Expand Down

0 comments on commit 973630e

Please sign in to comment.