Skip to content

Commit bf2b9fa

Browse files
authored
fix(b-form-checkbox-group, b-form-radio-group): only emit input when value loosely changes
1 parent a4dbf7f commit bf2b9fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mixins/form-radio-check-group.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { htmlOrText } from '../utils/html'
2+
import looseEqual from '../utils/loose-equal'
23
import normalizeSlotMixin from './normalize-slot'
34
import { BFormCheckbox } from '../components/form-checkbox/form-checkbox'
45
import { BFormRadio } from '../components/form-radio/form-radio'
@@ -70,8 +71,10 @@ export default {
7071
checked(newVal) {
7172
this.localChecked = newVal
7273
},
73-
localChecked(newVal) {
74-
this.$emit('input', newVal)
74+
localChecked(newVal, oldVal) {
75+
if (!looseEqual(newVal, oldVal)) {
76+
this.$emit('input', newVal)
77+
}
7578
}
7679
},
7780
render(h) {

0 commit comments

Comments
 (0)