-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(search): added default support and test #1915
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
base: main
Are you sure you want to change the base?
feat(search): added default support and test #1915
Conversation
Sakthieswaran-tech
commented
Nov 30, 2025
- Show default value when input is empty.
- Pressing Tab fills the prompt with default or selected choice.
- Added test to verify default display, prefill behavior, and correct selection.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1915 +/- ##
=======================================
Coverage ? 94.72%
=======================================
Files ? 37
Lines ? 1554
Branches ? 461
=======================================
Hits ? 1472
Misses ? 80
Partials ? 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
packages/search/search.test.ts
Outdated
| "? Select a Canadian province (New) | ||
| ❯ Alberta |
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.
It's a little weird the default value does nothing here.
Also, is this really a default value? Or a starting search string? Like here if we press enter, there's no valid value selected.
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.
I think I missed one part of the flow.
When there's no search term, the first item gets auto-selected, but this conflicts with how defaultValue is expected to work—Enter should pick the default.
Could you clarify what the intended behavior should be here? That will help me proceed correctly.
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.
Yeah, I think there's 2 things:
- We should select the default value on load
- We should validate that the default value is valid and exists
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.
I’ve updated the prompt so the default value is now selected on load and properly validated. Please have a look and let me know if any further changes are needed.
7e7479b to
95f2b54
Compare
dad292f to
22b4367
Compare