nextcloud-libraries/nextcloud-vue

`NcActions` doesn't work inside an element with a focus trap in a general case

Closed this issue · 4 comments

NcActions handles keydown on the menu element. It works only when a menu item has a focus.

Because NcActions renders in the body by default, when it's used in a component with a focus trap, the focus trap blocks the focus and breaks keyboard navigation.

In a specific case, it can be adjusted by setting container. But not in a general case.

The current idea — provide a container for mounting from an element with a focus trap (overlapping elements like Navigation, Sidebar, Modal), and not to mount in the body by default.

Please pay attention on closing mechanism via esc: NcActions have to be "closable" via Esc and be independent of a context where they are rendered (one Esc should not close search contacts and NcActions in a same time).

Peek 2024-01-11 09-51

I tested this on stable28 and focus trap does not seem to work:

Aufzeichnung.2024-02-02.132624.mp4

Ok, server on stable28 still have an old "@nextcloud/vue": "^8.4.0" but needs v8.6.0. Moving to Parked.