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

Handle tabstop wrapping for dynamic focusable content #25

Open
1j01 opened this issue May 7, 2021 · 0 comments
Open

Handle tabstop wrapping for dynamic focusable content #25

1j01 opened this issue May 7, 2021 · 0 comments

Comments

@1j01
Copy link

1j01 commented May 7, 2021

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant