Skip to content

Commit 69ea81e

Browse files
committed
fix blur/focus classes adn radio array
1 parent ccf7517 commit 69ea81e

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

src/components/BFormCheckbox/BFormCheckbox.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
:aria-required="name && required ? 'true' : null"
1717
:value="value"
1818
:indeterminate="indeterminate"
19+
@focus="isFocused = true"
20+
@blur="isFocused = false"
1921
/>
2022
<label
2123
v-if="$slots.default || !plain"

src/components/BFormCheckbox/BFormCheckboxGroup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</template>
2020

2121
<script lang="ts">
22-
import {computed, defineComponent, PropType, watch} from 'vue'
22+
import {computed, defineComponent, PropType} from 'vue'
2323
import {ColorVariant, Size} from '../../types'
2424
import useId from '../../composables/useId'
2525
import {

src/components/BFormRadio/BFormRadio.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
:aria-labelledby="ariaLabelledBy"
1616
:value="value"
1717
:aria-required="name && required ? 'true' : null"
18+
@focus="isFocused = true"
19+
@blur="isFocused = false"
1820
/>
1921
<label
2022
v-if="$slots.default || !plain"
@@ -28,7 +30,7 @@
2830

2931
<script lang="ts">
3032
import {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'
31-
import {computed, defineComponent, onMounted, PropType, Ref, ref, watch} from 'vue'
33+
import {computed, defineComponent, onMounted, PropType, Ref, ref} from 'vue'
3234
import useId from '../../composables/useId'
3335
3436
export default defineComponent({
@@ -59,11 +61,12 @@ export default defineComponent({
5961
const isFocused = ref(false)
6062
6163
const localValue: any = computed({
62-
get: () => props.modelValue,
64+
get: () => (Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue),
6365
set: (newValue: any) => {
64-
emit('input', newValue)
65-
emit('change', newValue)
66-
emit('update:modelValue', newValue)
66+
const emitValue = Array.isArray(props.modelValue) ? [newValue] : newValue
67+
emit('input', emitValue)
68+
emit('change', emitValue)
69+
emit('update:modelValue', emitValue)
6770
},
6871
})
6972

src/components/BLink/BLink.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@ export default defineComponent({
9999
return toFallback
100100
})
101101
102-
const focus = () => {
103-
if (!props.disabled) link.value.focus()
104-
}
105-
106-
const blur = () => {
107-
if (!props.disabled) {
108-
link.value.blur()
109-
}
110-
}
111-
112102
const clicked = function (e: PointerEvent) {
113103
if (props.disabled) {
114104
e.preventDefault()

0 commit comments

Comments
 (0)