Skip to content

Commit

Permalink
fix(VMenu): don't add button role with openOnHover
Browse files Browse the repository at this point in the history
fixes #14377
  • Loading branch information
KaelWD committed Dec 27, 2021
1 parent 28a64c4 commit 24ccd88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Expand Up @@ -2,8 +2,7 @@

exports[`activatable.ts should render activator slot with hover 1`] = `
<div>
<button role="button"
aria-haspopup="true"
<button aria-haspopup="true"
aria-expanded="false"
>
</button>
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/mixins/activatable/index.ts
Expand Up @@ -93,7 +93,7 @@ export default baseMixins.extend({
},
genActivatorAttributes () {
return {
role: 'button',
role: (this.openOnClick && !this.openOnHover) ? 'button' : undefined,
'aria-haspopup': true,
'aria-expanded': String(this.isActive),
}
Expand Down
14 changes: 8 additions & 6 deletions packages/vuetify/src/mixins/menuable/index.ts
Expand Up @@ -297,13 +297,15 @@ export default baseMixins.extend<options>().extend({

const onClick = listeners.click

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

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

return listeners
Expand Down

0 comments on commit 24ccd88

Please sign in to comment.