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

Mimic browser select on focus when navigating via Tab #1272

Merged
merged 4 commits into from
Mar 28, 2022
Merged

Mimic browser select on focus when navigating via Tab #1272

merged 4 commits into from
Mar 28, 2022

Conversation

smacpherson64
Copy link
Contributor

@smacpherson64 smacpherson64 commented Mar 25, 2022

When using a Dialog, if a user tabs into an input or textarea element, the default browser behavior of selecting the text is not occurring. Instead the cursor is sent to the end of the input.

This PR resolves this by selecting the text if the element is able to select the text.

resolves #1271

When calling focusIn if the next node is selectable select all the text.
@vercel
Copy link

vercel bot commented Mar 25, 2022

@smacpherson64 is attempting to deploy a commit to the Tailwind Labs Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Mar 25, 2022

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/playground-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/BB33L4W7sN2s9GHncF2UwG3uTh1n
✅ Preview: https://headlessui-react-git-fork-smacpherson64-foc-2d3622-tailwindlabs.vercel.app

headlessui-vue – ./packages/playground-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/3hvHMiJcEj9FB3CfZKgdJ3sA4A1S
✅ Preview: https://headlessui-vue-git-fork-smacpherson64-focus-3be02e-tailwindlabs.vercel.app

@RobinMalfait RobinMalfait changed the title mimic browser select on focus Mimic browser select on focus when navigating via <kbd>Tab</kbd> Mar 28, 2022
@RobinMalfait RobinMalfait changed the title Mimic browser select on focus when navigating via <kbd>Tab</kbd> Mimic browser select on focus when navigating via Tab Mar 28, 2022
@RobinMalfait
Copy link
Member

Hey! Thank you for your PR!
Much appreciated! 🙏

@smacpherson64 smacpherson64 deleted the focus-in-modal-fix branch March 28, 2022 14:22
@smacpherson64
Copy link
Contributor Author

Glad to be part! Thank you!

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.

tabbed focus differences inside and outside of dialog
2 participants