fix(combo): Invalid data state on tab out in single selection#2224
Open
rkaraivanov wants to merge 2 commits into
Open
fix(combo): Invalid data state on tab out in single selection#2224rkaraivanov wants to merge 2 commits into
rkaraivanov wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an invalid state in the igc-combo single-select mode by committing the currently active match (or clearing selection) when the user tabs out of the component, aligning the displayed text with the component value and resolving #2221.
Changes:
- Update Combo navigation Tab handling to select the active item (or clear) before closing in single-select mode.
- Add a unit test covering tab-out behavior with a single match and with no matches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/combo/controllers/navigation.ts | Adjusts Tab key handling to commit/clear selection before hiding the dropdown in single-select mode. |
| src/components/combo/combo.spec.ts | Adds regression test for single-select tab-out with matches vs. no matches. |
- Do not call clearSelection() on Tab when active === -1 in single-select mode; an existing selection is preserved when no navigation occurred - Sync the native input value after _syncValueFromSelection so the main input reflects the current selection in single-select mode - Clear the native input value on blur when there is no selection, discarding any partial search text the user typed - Add tests covering the three affected scenarios
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
When tabbing out of a single select combo, commit the value if there is at least one match.
mode; an existing selection is preserved when no navigation occurred
input reflects the current selection in single-select mode
discarding any partial search text the user typed
Type of Change
Related Issues
Closes #2221
Testing
Added unit test covering the scenario.
Checklist