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

Undefined behavior when active element is being removed #321

Closed
theKashey opened this issue Aug 9, 2024 · 0 comments
Closed

Undefined behavior when active element is being removed #321

theKashey opened this issue Aug 9, 2024 · 0 comments

Comments

@theKashey
Copy link
Owner

There is no clear behavior for the situations when focused element is being removed or disabled.

  • Expectation - a new focused element is picked
  • Reality - focus is lost to body

One can use existing restoreFocus logic to pick element closest to the previously selected, or run auto-focus from scratch.

theKashey added a commit that referenced this issue Aug 25, 2024
fix: auto-focus in case of activeElement disappearance, fixes #321
nickspaargaren pushed a commit to nickspaargaren/react-focus-lock that referenced this issue Dec 11, 2024
nickspaargaren pushed a commit to nickspaargaren/react-focus-lock that referenced this issue Dec 11, 2024
fix: auto-focus in case of activeElement disappearance, fixes theKashey#321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant