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

Combobox: Shift + Home/End not working as expected #2022

Closed
justindmyers opened this issue Nov 17, 2022 · 1 comment · Fixed by #2024
Closed

Combobox: Shift + Home/End not working as expected #2022

justindmyers opened this issue Nov 17, 2022 · 1 comment · Fixed by #2024
Assignees

Comments

@justindmyers
Copy link

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.7.4

What browser are you using?

Chrome 107.0.5304.107 64-bit

Reproduction URL

The behavior can be seen on the Headless UI examples:
https://headlessui.com/react/combobox

Describe your issue

Using Shift + Home or Shift + End is not currently working to select text.

Briefly looking at the code: Home/End are both used for highlighting a selection within the combo box, but this is also preventing those keys from being used for selecting text with the Shift modifier.

Since using Shift + Home/End for selecting text within an <input /> is standard browser behavior, this functionality should still be available within the Combobox input field as well.

For reference: according to the W3C best practices for a Combobox, Home/End should be used for the input field but currently the keys are only used for navigating to the first/last selection in the popup, regardless of the popup being open/closed.

Home - Moves visual focus to the textbox and places the editing cursor at the beginning of the field.
End - Moves visual focus to the textbox and places the editing cursor at the end of the field.

@RobinMalfait
Copy link
Collaborator

Hey! Thank you for your bug report!
Much appreciated! 🙏

We've implemented the Home/End keys to similar libraries and other components.
This should be fixed by #2024, and will be available in the next release.

You can already try it using:

  • npm install @headlessui/react@insiders.
  • npm install @headlessui/vue@insiders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants