-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: combobox's new feature, autocomplete with typeahead #17268
feat: combobox's new feature, autocomplete with typeahead #17268
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
@Gururajj77 Are there design specs for the functionality of this new feature? I think in matching 1:1 with the filtering behavior, autocomplete is too aggressive and unpredictable. Unless users know exactly when to stop typing, extra characters get inserted into the matching string. If users try to delete the text, the autocomplete can insert other matching strings (try deleting apple
), or even prevent them from deleting at all (try deleting banana
). Using the clear (x
) button also doesn't always clear the text. The only reliable way is to select all and delete.
Sep-09-2024.09-23-29.mp4
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.
Looks great! Just a few things we discussed in our review pairing session today
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.
A few extra things on the tests
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17268 +/- ##
==========================================
+ Coverage 77.08% 77.19% +0.11%
==========================================
Files 409 409
Lines 14024 14076 +52
Branches 4327 4344 +17
==========================================
+ Hits 10810 10866 +56
+ Misses 3043 3039 -4
Partials 171 171 ☔ View full report in Codecov by Sentry. |
I also tried to use this with |
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.
Looks good to me.
7776f11
Hey there! v11.68.0 was just released that references this issue/PR. |
…ign-system#17268) * feat: autocomplete is fked * feat: autoComplete typeahead feature fixed * feat: added tests for autocomplete * feat: adds functionality test cases * feat: matcsh case exactly with option list when Tab is pressed * feat: adds tests, refines functions * feat: updated prop name to component and tests * refactor: fixed conflict * test: covered allowcustomValue prop --------- Co-authored-by: Nikhil Tomar <[email protected]> Co-authored-by: Nikhil Tomar <[email protected]>
Closes #14007
Added autocomplete and typeahead feature for combobox with custom filter to support the typeahead.
Changelog
New
autocomplete
propautocompleteCustomFunction
which is 1-to-1 mapping filter function which filters matching both character and position.autocomplete
andautocompleteCustomFunction
are working.Changed
getMenuProps
andrefs.setFloationg
touseMemo
hookact
in the test helpersTesting / Reviewing