A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/37ec7e9991b66af51ff81420da8eb88928615f9d below:

`chnage` event timing (#6008) · bootstrap-vue/bootstrap-vue@37ec7e9 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+30

-20

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+30

-20

lines changed Original file line number Diff line number Diff line change

@@ -102,16 +102,19 @@ export const BFormCheckbox = /*#__PURE__*/ Vue.extend({

102 102

}

103 103

this.computedLocalChecked = localChecked

104 104 105 -

// Change is only emitted on user interaction

106 -

this.$emit('change', localChecked)

105 +

// Fire events in a `$nextTick()` to ensure the `v-model` is updated

106 +

this.$nextTick(() => {

107 +

// Change is only emitted on user interaction

108 +

this.$emit('change', localChecked)

107 109 108 -

// If this is a child of `<form-checkbox-group>`,

109 -

// we emit a change event on it as well

110 -

if (this.isGroup) {

111 -

this.bvGroup.$emit('change', localChecked)

112 -

}

110 +

// If this is a child of `<form-checkbox-group>`,

111 +

// we emit a change event on it as well

112 +

if (this.isGroup) {

113 +

this.bvGroup.$emit('change', localChecked)

114 +

}

113 115 114 -

this.$emit('update:indeterminate', indeterminate)

116 +

this.$emit('update:indeterminate', indeterminate)

117 +

})

115 118

},

116 119

setIndeterminate(state) {

117 120

// Indeterminate only supported in single checkbox mode

Original file line number Diff line number Diff line change

@@ -31,11 +31,9 @@ export const BFormRadio = /*#__PURE__*/ Vue.extend({

31 31

}

32 32

},

33 33

computed: {

34 -

// Radio Groups can only have a single value, so determining if checked is simple

35 34

isChecked() {

36 35

return looseEqual(this.value, this.computedLocalChecked)

37 36

},

38 -

// Flags for form-radio-check mixin

39 37

isRadio() {

40 38

return true

41 39

},

@@ -44,21 +42,30 @@ export const BFormRadio = /*#__PURE__*/ Vue.extend({

44 42

}

45 43

},

46 44

watch: {

47 -

// Radio Groups can only have a single value, so our watchers are simple

48 -

computedLocalChecked() {

49 -

this.$emit('input', this.computedLocalChecked)

45 +

computedLocalChecked(newValue, oldValue) {

46 +

if (!looseEqual(newValue, oldValue)) {

47 +

this.$emit('input', newValue)

48 +

}

50 49

}

51 50

},

52 51

methods: {

53 52

handleChange({ target: { checked } }) {

54 -

const value = this.value

53 +

const { value } = this

54 +

const localChecked = checked ? value : null

55 + 55 56

this.computedLocalChecked = value

56 -

// Change is only emitted on user interaction

57 -

this.$emit('change', checked ? value : null)

58 -

// If this is a child of form-radio-group, we emit a change event on it as well

59 -

if (this.isGroup) {

60 -

this.bvGroup.$emit('change', checked ? value : null)

61 -

}

57 + 58 +

// Fire events in a `$nextTick()` to ensure the `v-model` is updated

59 +

this.$nextTick(() => {

60 +

// Change is only emitted on user interaction

61 +

this.$emit('change', localChecked)

62 + 63 +

// If this is a child of `<form-radio-group>`,

64 +

// we emit a change event on it as well

65 +

if (this.isGroup) {

66 +

this.bvGroup.$emit('change', localChecked)

67 +

}

68 +

})

62 69

}

63 70

}

64 71

})

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4