Skip to content

Commit

Permalink
fix(VCalendar): don't use nativeOn on native elements (#11112)
Browse files Browse the repository at this point in the history
fixes #9999

* fix(VCalendar): don't use nativeOn on native elements

* fix(VList): don't use nativeOn when inactive
  • Loading branch information
KaelWD committed Apr 24, 2020
1 parent f51bef6 commit 50d6047
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 37 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -53,9 +53,9 @@
"tslint": "^5.18.0",
"typescript": "^3.5.3",
"typestrict": "^1.0.2",
"vue": "^2.6.10",
"vue": "^2.6.11",
"vue-loader": "^15.7.1",
"vue-template-compiler": "^2.6.10",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6",
"webpack-merge": "^4.2.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/api-generator/package.json
Expand Up @@ -14,7 +14,7 @@
"license": "ISC",
"dependencies": {
"deepmerge": "^4.0.0",
"vue": "^2.6.10",
"vue": "^2.6.11",
"vuetify": "^2.2.23"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Expand Up @@ -41,7 +41,7 @@
"vue-i18n": "^8.12.0",
"vue-no-ssr": "^1.1.1",
"vue-router": "^3.0.7",
"vue-server-renderer": "^2.6.10",
"vue-server-renderer": "^2.6.11",
"vuelidate": "^0.7.4",
"vuetify": "^2.2.23",
"vuex": "^3.1.1",
Expand Down
Expand Up @@ -237,7 +237,7 @@ export default CalendarWithIntervals.extend({
render (h): VNode {
return h('div', {
class: this.classes,
nativeOn: {
on: {
dragstart: (e: MouseEvent) => {
e.preventDefault()
},
Expand Down
Expand Up @@ -171,7 +171,7 @@ export default CalendarBase.extend({
return h('div', {
staticClass: this.staticClass,
class: this.classes,
nativeOn: {
on: {
dragstart: (e: MouseEvent) => {
e.preventDefault()
},
Expand Down
Expand Up @@ -36,7 +36,7 @@ export default mixins(header).extend({

return this.$createElement(VChip, {
staticClass: 'sortable',
nativeOn: {
on: {
click: (e: MouseEvent) => {
e.stopPropagation()
this.$emit('sort', props.item.value)
Expand Down
Expand Up @@ -82,7 +82,7 @@ export default mixins(
icon: true,
light: this.light,
},
nativeOn: {
on: {
click: (e: Event) => {
e.stopPropagation()
this.$emit('input', this.calculateChange(change))
Expand Down
30 changes: 16 additions & 14 deletions packages/vuetify/src/components/VList/VListItem.ts
Expand Up @@ -20,6 +20,7 @@ import { removed } from '../../util/console'
import mixins from '../../util/mixins'
import { VNode } from 'vue'
import { PropType, PropValidator } from 'vue/types/options'
import mergeData from '../../util/mergeData'

const baseMixins = mixins(
Colorable,
Expand Down Expand Up @@ -155,19 +156,22 @@ export default baseMixins.extend<options>().extend({
render (h): VNode {
let { tag, data } = this.generateRouteLink()

data.attrs = {
...data.attrs,
...this.genAttrs(),
}
data.on = {
...data.on,
click: this.click,
keydown: (e: KeyboardEvent) => {
/* istanbul ignore else */
if (e.keyCode === keyCodes.enter) this.click(e)

this.$emit('keydown', e)
data = mergeData(data, {
attrs: this.genAttrs(),
[this.to ? 'nativeOn' : 'on']: {
keydown: (e: KeyboardEvent) => {
/* istanbul ignore else */
if (e.keyCode === keyCodes.enter) this.click(e)

this.$emit('keydown', e)
},
},
})

if (this.inactive) tag = 'div'
if (this.inactive && this.to) {
data.on = data.nativeOn
delete data.nativeOn
}

const children = this.$scopedSlots.default
Expand All @@ -177,8 +181,6 @@ export default baseMixins.extend<options>().extend({
})
: this.$slots.default

tag = this.inactive ? 'div' : tag

return h(tag, this.setTextColor(this.color, data), children)
},
})
30 changes: 15 additions & 15 deletions yarn.lock
Expand Up @@ -11630,7 +11630,7 @@ serialize-error@^2.1.0:
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a"
integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=

serialize-javascript@^1.3.0, serialize-javascript@^1.7.0:
serialize-javascript@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65"
integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==
Expand Down Expand Up @@ -13358,18 +13358,18 @@ vue-router@^3.0.7:
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.7.tgz#b36ca107b4acb8ff5bc4ff824584059c23fcb87b"
integrity sha512-utJ+QR3YlIC/6x6xq17UMXeAfxEvXA0VKD3PiSio7hBOZNusA1jXcbxZxVEfJunLp48oonjTepY8ORoIlRx/EQ==

vue-server-renderer@^2.6.10:
version "2.6.10"
resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.6.10.tgz#cb2558842ead360ae2ec1f3719b75564a805b375"
integrity sha512-UYoCEutBpKzL2fKCwx8zlRtRtwxbPZXKTqbl2iIF4yRZUNO/ovrHyDAJDljft0kd+K0tZhN53XRHkgvCZoIhug==
vue-server-renderer@^2.6.11:
version "2.6.11"
resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.6.11.tgz#be8c9abc6aacc309828a755c021a05fc474b4bc3"
integrity sha512-V3faFJHr2KYfdSIalL+JjinZSHYUhlrvJ9pzCIjjwSh77+pkrsXpK4PucdPcng57+N77pd1LrKqwbqjQdktU1A==
dependencies:
chalk "^1.1.3"
hash-sum "^1.0.2"
he "^1.1.0"
lodash.template "^4.4.0"
lodash.template "^4.5.0"
lodash.uniq "^4.5.0"
resolve "^1.2.0"
serialize-javascript "^1.3.0"
serialize-javascript "^2.1.2"
source-map "0.5.6"

vue-style-loader@^4.1.0, vue-style-loader@^4.1.2:
Expand All @@ -13380,10 +13380,10 @@ vue-style-loader@^4.1.0, vue-style-loader@^4.1.2:
hash-sum "^1.0.2"
loader-utils "^1.0.2"

vue-template-compiler@^2.6.10:
version "2.6.10"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz#323b4f3495f04faa3503337a82f5d6507799c9cc"
integrity sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==
vue-template-compiler@^2.6.11:
version "2.6.11"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz#c04704ef8f498b153130018993e56309d4698080"
integrity sha512-KIq15bvQDrcCjpGjrAhx4mUlyyHfdmTaoNfeoATHLAiWB+MU3cx4lOzMwrnUh9cCxy0Lt1T11hAFY6TQgroUAA==
dependencies:
de-indent "^1.0.2"
he "^1.1.0"
Expand All @@ -13393,10 +13393,10 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==

vue@^2.6.10:
version "2.6.10"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637"
integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==
vue@^2.6.11:
version "2.6.11"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"
integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==

vuelidate@^0.7.4:
version "0.7.4"
Expand Down

0 comments on commit 50d6047

Please sign in to comment.