-
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0777e18
bail the refocus if focus is already on the correct element
RobinMalfait cd851d9
use `mousedown` instead of `click` event
RobinMalfait a973f43
add comments to describe _why_ we use `mousedown`
RobinMalfait 135b0b8
ensure we handle mouse buttons correctly
RobinMalfait f30343e
ensure we handle `Enter` and `Space` explicitly
RobinMalfait 35ed5dc
ensure we focus the first element when using `ArrowDown` on the `Comb…
RobinMalfait 16e57b6
fix tiny typo
RobinMalfait da5ef56
update changelog
RobinMalfait 64832a7
ensure we reset the `isTyping` flag
RobinMalfait 258baba
ensure unique callbacks in the `_disposables` array
RobinMalfait 59bea45
Update packages/@headlessui-react/src/components/combobox/combobox.tsx
RobinMalfait ac30fc3
Update packages/@headlessui-react/src/components/combobox/combobox.tsx
RobinMalfait 3e42d7d
update comments
RobinMalfait 4b68e63
abstract confusing logic to a `useFrameDebounce()` hook
RobinMalfait 4fed338
use correct path import
RobinMalfait 7dcd4ac
add some breathing room
RobinMalfait File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum MouseButton { | ||
Left = 0, | ||
Right = 2, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
dd
variable here is confusing to me — what does it mean? I know we typically used
for disposables, so is it just because you have two disposables in this case? Wondering if we can come up with a better name here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep we already had
d
but that had a different use case. To solve this, I created auseFrameDebounce()
hook (we can improve this name if we want). But now we can do this instead: