-
Notifications
You must be signed in to change notification settings - Fork 6
Debounce the search field's sl-clear event while typing
#2816
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
Conversation
🦋 Changeset detectedLatest commit: 18ffc02 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 |
🕸 Website previewYou can view a preview here (commit |
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.
Pull Request Overview
This PR adds debounced search functionality to the search field component. When users type, the sl-search event is now emitted automatically after 300ms of inactivity, rather than only on Enter key press.
Key changes:
- Adds automatic debounced
sl-searchevent emission (300ms delay) during typing - Cancels debounce timer when Enter is pressed or field is cleared
- Skips emitting search events for empty/whitespace-only values
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/components/search-field/src/search-field.ts | Implements debounce timer mechanism with input listener and helper methods |
| packages/components/search-field/src/search-field.spec.ts | Adds comprehensive test coverage for debounced search behavior |
| .changeset/forty-showers-smash.md | Documents the feature change, but mentions wrong event name |
🕸 Storybook previewYou can view a preview here (commit |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Fixes #2766