Commit 17094133c1796a1f4521ea4f3f622cd96a9466d5
Committed by
GitHub
Merge pull request #1 from SergioCrisostomo/chackbox_tabindex2
Focus on <label> when <input> gets the focus
Showing
1 changed file
with
8 additions
and
4 deletions
Show diff stats
src/components/checkbox/checkbox.vue
@@ -8,22 +8,26 @@ | @@ -8,22 +8,26 @@ | ||
8 | <input | 8 | <input |
9 | v-if="group" | 9 | v-if="group" |
10 | type="checkbox" | 10 | type="checkbox" |
11 | - tabindex="-1" | 11 | + tabindex="-1" |
12 | :class="inputClasses" | 12 | :class="inputClasses" |
13 | :disabled="disabled" | 13 | :disabled="disabled" |
14 | :value="label" | 14 | :value="label" |
15 | v-model="model" | 15 | v-model="model" |
16 | :name="name" | 16 | :name="name" |
17 | - @change="change"> | 17 | + @change="change" |
18 | + @focus="$el.focus()" | ||
19 | + > | ||
18 | <input | 20 | <input |
19 | v-if="!group" | 21 | v-if="!group" |
20 | type="checkbox" | 22 | type="checkbox" |
21 | - tabindex="-1" | 23 | + tabindex="-1" |
22 | :class="inputClasses" | 24 | :class="inputClasses" |
23 | :disabled="disabled" | 25 | :disabled="disabled" |
24 | :checked="currentValue" | 26 | :checked="currentValue" |
25 | :name="name" | 27 | :name="name" |
26 | - @change="change"> | 28 | + @change="change" |
29 | + @focus="$el.focus()" | ||
30 | + > | ||
27 | </span> | 31 | </span> |
28 | <slot><span v-if="showSlot">{{ label }}</span></slot> | 32 | <slot><span v-if="showSlot">{{ label }}</span></slot> |
29 | </label> | 33 | </label> |