-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Keep focus inside of the <ComboboxInput />
component
#3073
Commits on Apr 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0777e18 - Browse repository at this point
Copy the full SHA 0777e18View commit details -
use
mousedown
instead ofclick
eventThe `mousedown` event happens before the `focus` event. When we `e.preventDefault()` in this listener, the `focus` event will not fire. This also means that the focus is not lost on the actual `input` component which in turn means that we can maintain the selection / cursor position inside the `input`. We still use the `refocusInput()` as a fallback in case something else goes wrong.
Configuration menu - View commit details
-
Copy full SHA for cd851d9 - Browse repository at this point
Copy the full SHA cd851d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for a973f43 - Browse repository at this point
Copy the full SHA a973f43View commit details -
Configuration menu - View commit details
-
Copy full SHA for 135b0b8 - Browse repository at this point
Copy the full SHA 135b0b8View commit details -
ensure we handle
Enter
andSpace
explicitlyNow that we use the `mousedown` event instead of the `click` event, we have to make sure that we handle the `enter` and `space` keys explicitly. This used to be covered by the `click` event, but not for the `mousedown` event.
Configuration menu - View commit details
-
Copy full SHA for f30343e - Browse repository at this point
Copy the full SHA f30343eView commit details -
ensure we focus the first element when using
ArrowDown
on the `Comb……oboxButton` We go to the last one on `ArrownUp`, but we forgot to do this on `ArrowDown`.
Configuration menu - View commit details
-
Copy full SHA for 35ed5dc - Browse repository at this point
Copy the full SHA 35ed5dcView commit details -
Not related to this PR, but noticed it and fixed it anyway.
Configuration menu - View commit details
-
Copy full SHA for 16e57b6 - Browse repository at this point
Copy the full SHA 16e57b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for da5ef56 - Browse repository at this point
Copy the full SHA da5ef56View commit details -
ensure we reset the
isTyping
flagWhile we are typing, the flag can remain true. But once we stop typing, the `nextFrame` handler will kick in and set it to `false` again. It currently behaves as a debounce-like function such that the `nextFrame` callbacks are cancelled once a new event is fired.
Configuration menu - View commit details
-
Copy full SHA for 64832a7 - Browse repository at this point
Copy the full SHA 64832a7View commit details -
ensure unique callbacks in the
_disposables
arrayThis allows us to keep re-adding dispose functions and only register the callbacks once. Ideally we can use a `Set`, but we also want to remove a single callback if the callback is disposed on its own instead of disposing the whole group. For this we do require an `idx` which is not available in a `Set` unless you are looping over all disposable functions.
Configuration menu - View commit details
-
Copy full SHA for 258baba - Browse repository at this point
Copy the full SHA 258babaView commit details
Commits on Apr 3, 2024
-
Update packages/@headlessui-react/src/components/combobox/combobox.tsx
Co-authored-by: Jonathan Reinink <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 59bea45 - Browse repository at this point
Copy the full SHA 59bea45View commit details -
Update packages/@headlessui-react/src/components/combobox/combobox.tsx
Co-authored-by: Jonathan Reinink <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ac30fc3 - Browse repository at this point
Copy the full SHA ac30fc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e42d7d - Browse repository at this point
Copy the full SHA 3e42d7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b68e63 - Browse repository at this point
Copy the full SHA 4b68e63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fed338 - Browse repository at this point
Copy the full SHA 4fed338View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7dcd4ac - Browse repository at this point
Copy the full SHA 7dcd4acView commit details