Skip to content

Commit baeb7ba

Browse files
committed
fix(VMenu): prefer the activator slot over a click event
fixes #6906
1 parent d177c3b commit baeb7ba

File tree

1 file changed

+7
-5
lines changed
  • packages/vuetify/src/mixins/activatable

1 file changed

+7
-5
lines changed

packages/vuetify/src/mixins/activatable/index.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,10 @@ export default baseMixins.extend({
135135
// HTMLElement | Element
136136
activator = this.activator
137137
}
138-
} else if (e) {
139-
// Activated by a click event
140-
activator = (e.currentTarget || e.target) as HTMLElement
141-
} else if (this.activatorNode.length) {
142-
// Last resort, use the contents of the activator slot
138+
} else if (this.activatorNode.length === 1 || !e) {
139+
// Use the contents of the activator slot
140+
// There's either only one element in it or we
141+
// don't have a click event to use as a last resort
143142
const vm = this.activatorNode[0].componentInstance
144143
if (
145144
vm &&
@@ -151,6 +150,9 @@ export default baseMixins.extend({
151150
} else {
152151
activator = this.activatorNode[0].elm as HTMLElement
153152
}
153+
} else if (e) {
154+
// Activated by a click event
155+
activator = (e.currentTarget || e.target) as HTMLElement
154156
}
155157

156158
this.activatorElement = activator

0 commit comments

Comments
 (0)