Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NcActions] doesn't fully support changing type during open state #5334

Open
ShGKme opened this issue Mar 1, 2024 · 0 comments
Open

[NcActions] doesn't fully support changing type during open state #5334

ShGKme opened this issue Mar 1, 2024 · 0 comments
Assignees
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working feature: actions Related to the actions components

Comments

@ShGKme
Copy link
Contributor

ShGKme commented Mar 1, 2024

NcActions can have a different type: navigation (expanded list), application menu, form dialog.
It not only changes attributes for a11y but also keyboard navigation and focus-trap integration.

But it doesn't work well when it is changed during menu usage.

Example — renaming an address book in Contacts app.

  1. Initially it is a menu without a focus trap. Opening this menu pauses the global focus trap (e.g. current modal). It is needed because in a DOM menu is rendered outside the modal with a focus trap, and otherwise modal's trap breaks navigation in actions. It is supposed to be unpaused on close.
    image
  2. On "Edit" click it, this menu item is replaced with input. With a form, this popup is no longer a menu but a dialog form. Dialog is supposed to have its own focus trap. But it doesn't, because a focus trap should have been enabled initially in NcPopover.
    image
  3. When the dialog is closed, the global focus trap is not unpaused. Because it is not needed for the dialog. So the focus trap of modal is broken now.

A solution could be:

  1. Add focusTrap setting change support to NcPopover so we can enable focusTrap for existed dialog
  2. Always unpause the focus trap in NcActions on close if it was paused before, not matter if was expected.

See also: nextcloud/contacts#3812

@ShGKme ShGKme added bug Something isn't working 1. to develop Accepted and waiting to be taken care of feature: actions Related to the actions components labels Mar 1, 2024
@ShGKme ShGKme self-assigned this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working feature: actions Related to the actions components
Projects
None yet
Development

No branches or pull requests

1 participant