Skip to content

Commit

Permalink
fix(NcActions): Remove on mousemove listener for auto focus elements
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler authored Jan 31, 2025
1 parent a3006e5 commit 99281ec
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1424,31 +1424,6 @@ export default {
return this.$refs.menu.querySelectorAll(focusableSelector)
},

/**
* Focus nearest focusable item on mouse move.
* DO NOT change the focus if the target is already focused
* this will prevent issues with input being unfocused
* on mouse move
* @param {PointerEvent} event - The mouse move event
*/
onMouseFocusAction(event) {
if (document?.activeElement === event.target) {
return
}

const menuItem = event.target.closest('li')
if (menuItem && this.$refs.menu.contains(menuItem)) {
const focusableItem = menuItem.querySelector(focusableSelector)
if (focusableItem) {
const focusList = this.getFocusableMenuItemElements()
const focusIndex = [...focusList].indexOf(focusableItem)
if (focusIndex > -1) {
this.focusIndex = focusIndex
this.focusAction()
}
}
}
},
/**
* Dispatches the keydown listener to different handlers
*
Expand Down Expand Up @@ -1823,7 +1798,6 @@ export default {
},
tabindex: '-1',
onKeydown: this.onKeydown,
onMousemove: this.onMouseFocusAction,
ref: 'menu',
}, [
h('ul', {
Expand Down

0 comments on commit 99281ec

Please sign in to comment.