From 973630e1f275946ba689584002c2fe0235be7380 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Wed, 14 Feb 2024 12:29:39 +0300 Subject: [PATCH] Code refactor --- components/lib/selectbutton/SelectButton.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/lib/selectbutton/SelectButton.vue b/components/lib/selectbutton/SelectButton.vue index 61a8462ea..b086ea514 100755 --- a/components/lib/selectbutton/SelectButton.vue +++ b/components/lib/selectbutton/SelectButton.vue @@ -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)" @@ -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: {