Browse Source

fix: nativeEvent is not a complete Event object (#1811)

* fix: nativeEvent is not a complete Event object

The Spread syntax is only get own property of a Object,but many properties of Event is on it's prototypes chains, so the result is that the passed nativeEvent only has two property: isTrutsed  and shiftKey

* fix semicolon
pull/1835/head
Morphling 5 years ago committed by GitHub
parent
commit
f564f6d0dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      components/vc-checkbox/src/Checkbox.jsx

3
components/vc-checkbox/src/Checkbox.jsx

@ -77,6 +77,7 @@ export default {
this.sChecked = e.target.checked;
}
this.$forceUpdate(); // change
e.shiftKey = this.eventShiftKey;
this.__emit('change', {
target: {
...props,
@ -88,7 +89,7 @@ export default {
preventDefault() {
e.preventDefault();
},
nativeEvent: { ...e, shiftKey: this.eventShiftKey },
nativeEvent: e,
});
this.eventShiftKey = false;
},

Loading…
Cancel
Save