Skip to content

Commit

Permalink
fix(menuable): add support for disabling open-on-click
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 22, 2019
1 parent 4129aca commit f428829
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/vuetify/src/mixins/menuable/index.ts
Expand Up @@ -60,6 +60,7 @@ export default baseMixins.extend<options>().extend({
default: 0
},
offsetOverflow: Boolean,
openOnClick: Boolean,
positionX: {
type: Number,
default: null
Expand Down Expand Up @@ -260,6 +261,22 @@ export default baseMixins.extend<options>().extend({
this.activatorFixed = false
},
deactivate () {},
genActivatorListeners () {
const listeners = Activatable.options.methods.genActivatorListeners.call(this)

const onClick = listeners.click

listeners.click = (e: MouseEvent & KeyboardEvent) => {
if (this.openOnClick) {
onClick && onClick(e)
}

this.absoluteX = e.clientX
this.absoluteY = e.clientY
}

return listeners
},
getInnerHeight () {
if (!this.hasWindow) return 0

Expand Down

0 comments on commit f428829

Please sign in to comment.