Skip to content

Commit b013f4b

Browse files
Merge pull request #6479 from nextcloud-libraries/backport/6475/next
[next] fix(NcActions): Remove on `mousemove` listener for auto focus elements
2 parents c04c125 + 99281ec commit b013f4b

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

src/assets/action.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55

66
@mixin action-active {
77
li.action {
8+
&:hover,
89
&.active {
9-
background-color: var(--color-background-hover);
1010
border-radius: 6px;
1111
padding: 0;
1212
}
13+
14+
&:hover {
15+
background-color: var(--color-background-hover);
16+
}
1317
}
1418
}
1519

src/components/NcActions/NcActions.vue

-26
Original file line numberDiff line numberDiff line change
@@ -1424,31 +1424,6 @@ export default {
14241424
return this.$refs.menu.querySelectorAll(focusableSelector)
14251425
},
14261426

1427-
/**
1428-
* Focus nearest focusable item on mouse move.
1429-
* DO NOT change the focus if the target is already focused
1430-
* this will prevent issues with input being unfocused
1431-
* on mouse move
1432-
* @param {PointerEvent} event - The mouse move event
1433-
*/
1434-
onMouseFocusAction(event) {
1435-
if (document?.activeElement === event.target) {
1436-
return
1437-
}
1438-
1439-
const menuItem = event.target.closest('li')
1440-
if (menuItem && this.$refs.menu.contains(menuItem)) {
1441-
const focusableItem = menuItem.querySelector(focusableSelector)
1442-
if (focusableItem) {
1443-
const focusList = this.getFocusableMenuItemElements()
1444-
const focusIndex = [...focusList].indexOf(focusableItem)
1445-
if (focusIndex > -1) {
1446-
this.focusIndex = focusIndex
1447-
this.focusAction()
1448-
}
1449-
}
1450-
}
1451-
},
14521427
/**
14531428
* Dispatches the keydown listener to different handlers
14541429
*
@@ -1823,7 +1798,6 @@ export default {
18231798
},
18241799
tabindex: '-1',
18251800
onKeydown: this.onKeydown,
1826-
onMousemove: this.onMouseFocusAction,
18271801
ref: 'menu',
18281802
}, [
18291803
h('ul', {

0 commit comments

Comments
 (0)