fix(select): reset FormControl after clear (#DS-5182)#1658
Merged
Conversation
artembelik
approved these changes
Jun 24, 2026
|
Visit the preview URL for this PR (updated for commit fdabc57): https://koobiq-next--prs-1658-k7th04gk.web.app (expires Mon, 29 Jun 2026 13:03:31 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an issue in KbqSelect where clearing the value via kbq-cleaner didn’t correctly reset the bound FormControl, due to SelectionModel not emitting change events (leaving stale internal selection cache).
Changes:
- Updated
clearValueto callselectionModel.clear()(emit changes) instead ofclear(false)so the internal selected cache is properly reset. - Added unit tests to assert
FormControl.valueupdates after clicking the cleaner for both single- and multi-select. - Added a visual-selection regression test for multi-select to ensure options are deselected in the panel after clear.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/components/select/select.component.ts | Ensures clear action emits selection-model change events so clearing actually propagates to forms. |
| packages/components/select/select.component.spec.ts | Adds regression coverage for FormControl updates and visual deselection after using the cleaner. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lskramarov
approved these changes
Jun 29, 2026
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.
При исследовании inline-edit обнаружено, что после очистки
kbq-selectчерезkbq-cleanerзначениеFormControlне обновлялось.clearValue вызывал selectionModel.clear(false), что пропускало _emitChangeEvent — единственное место, где CDK сбрасывает кеш _selected.
В итоге, propagateChanges читал устаревший кеш через this.selected → selectionModel.selected и записывал старые значения обратно в FormControl.
Исправление: clear(false) → clear().
Добавлены тесты, проверяющие control.value после клика по cleaner.