fix(select): support igx-select-item inside nested @for/@if control flow blocks - 21.1.x#17202
Open
fix(select): support igx-select-item inside nested @for/@if control flow blocks - 21.1.x#17202
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an igx-select rendering issue where <igx-select-item> elements nested inside Angular control flow blocks (@for + @if/@else) are discovered via @ContentChildren but do not end up projected into the dropdown scroll container, resulting in an empty list.
Changes:
- Add DOM-reparenting logic in
IgxSelectComponentto move unprojected select items (and their groups) into the scroll container while preserving template order. - Add unit tests covering nested control flow scenarios for standalone items, grouped items, and groups inside control flow.
- Update the samples app to expose/select the Select sample and add a reproduction section.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/select/select.sample.ts | Adds sample data used to reproduce the nested control-flow scenario in the demo app. |
| src/app/select/select.sample.html | Adds a new sample section demonstrating @for + @if/@else with <igx-select-item>. |
| src/app/app.routes.ts | Registers a /select route to access the Select sample in the demo app. |
| src/app/app.component.ts | Adds a navigation entry for the new Select route in the demo app. |
| projects/igniteui-angular/select/src/select/select.component.ts | Implements moveItemsToScrollContainer() and invokes it on init and on children.changes to fix projection/rendering. |
| projects/igniteui-angular/select/src/select/select.component.spec.ts | Adds regression tests for nested control flow and group 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.
Closes #17164
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)