Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Handle tabstop wrapping for dynamic focusable content #25

@1j01

Description

@1j01

Currently the library gives errors when removing focusable elements in the dialog.

The tab wrapping stops working if the last focusable element in the dialog is removed.
This can be fixed, while simplifying things, by removing the classes of js-first-focus and js-last-focus and instead finding the first and last focusable elements when the wrapping is handled. The performance difference is nothing to worry about.

I also needed to prevent closing the dialog when clicking a button that removes itself. The click-outside feature was not finding the removed button within the modal, given that it's no longer in the DOM, and thus considering it a click outside the modal.

Here's the modal in question:
recovery modal 3
The Clear (and Save MIDI File) buttons cause the row to be removed (that contains them).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions