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

fix: outside click refocus bug #114

Merged
merged 5 commits into from Oct 20, 2020
Merged

Conversation

RobinMalfait
Copy link
Collaborator

@RobinMalfait RobinMalfait commented Oct 20, 2020

Fixes: #98

@vercel
Copy link

vercel bot commented Oct 20, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-react – ./packages/@headlessui-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/cyph5kecy
✅ Preview: https://headlessui-react-git-outside-click-refocus-bug.tailwindlabs.vercel.app

headlessui-vue – ./packages/@headlessui-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/piw89ptsv
✅ Preview: https://headlessui-vue-git-outside-click-refocus-bug.tailwindlabs.vercel.app

@RobinMalfait RobinMalfait changed the title outside click refocus bug fix: outside click refocus bug Oct 20, 2020
When we click outside of the Menu or Listbox, we want to
restore the focus to the Button, *unless* we clicked on/in an element
that is focusable in itself. For example, when the Menu is open and you
click in an input field, the input field should stay focused. We should
also close the Menu itself at this point.
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

Successfully merging this pull request may close these issues.

Glitch when switching focus from opened menu dropdown to text input
1 participant