fix: issue with autocomplete input blur - #3690
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: a26a609 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: +97 B (+0.01%) Total Size: 850 kB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3690 +/- ##
=======================================
Coverage 93.51% 93.52%
=======================================
Files 208 208
Lines 4614 4621 +7
Branches 1803 1805 +2
=======================================
+ Hits 4315 4322 +7
Misses 270 270
Partials 29 29
🚀 New features to boost your workflow:
|
|
|
||
| if (!movingInside) { | ||
| syncSearchOnDismiss(); | ||
| } |
There was a problem hiding this comment.
Thank you for catching this issue, @nicosommi 👏
I believe there could be a simpler way to address it. If we fire a change event here (like we do in the onComboboxClear callback) I believe we could achieve the same thing:
| } | |
| } | |
| if (!value && searchText !== '') { | |
| changeInputValue(comboboxRef.current, ''); | |
| } |
There was a problem hiding this comment.
Good call on reusing changeInputValue for the clear-to-empty path — adopted that in syncSearchOnDismiss for !value && searchText !== '' (and multi-select filter reset), same as onComboboxClear.
Kept setSearchText for the preselected-value restore path because firing a change to the label would debounce onSearch(label) and leave client-filtered options stale again. Still emit onSearch('') explicitly so consumers get the full list on reopen.
movingInside + syncSearchOnDismiss on Escape/modal close remain for Tab-close and immersive dismiss.
| } | ||
| }, [isOpen, update, options.length, value]); | ||
|
|
||
| const handleClickOutside = useCallback(() => { |
There was a problem hiding this comment.
removed in favor of addEventListener('focusout')
3e4d728 to
641b116
Compare
641b116 to
a26a609
Compare
No ticket yet
How to reproduce the issue
Purpose
Fix the issue mentioned above, spotted here
Approach and changes
Definition of done