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

Omnibar does not return focus when opened and closed for the second time #6873

Open
evansjohnson opened this issue Jun 26, 2024 · 0 comments

Comments

@evansjohnson
Copy link
Contributor

Steps to reproduce

https://blueprintjs.com/docs/#select/omnibar

  • Tab to button that opens omnibar
  • Hit enter
  • Close omnibar
  • See focus return to button
  • Repeat
  • See focus does not return to button

Actual behavior

From quick debugging, it looks like the dialog is trying to return focus to the input rendered in the omnibar dialog when closing the second time. This is due to thinking that the input is the "last focused element" the second time it opens.

Expected behavior

Omnibar should return focus since it does not override the Dialog's default shouldReturnFocusOnClose={true}. This is likely actually a Dialog issue but I did not attempt to reproduce outside of Omnibar yet.

Possible solution

Make sure the input that is rendered in the Dialog is not considered the last focused element before the Dialog opens

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