fix(select): support igx-select-item inside nested @for/@if control flow blocks - 20.1.x#17203
Open
fix(select): support igx-select-item inside nested @for/@if control flow blocks - 20.1.x#17203
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes igx-select rendering when igx-select-item (and groups) are placed inside nested Angular control-flow blocks (e.g. @for + @if/@else), where Angular content projection can fail to place nodes into the select’s scroll container.
Changes:
- Add DOM-reconciliation logic in
IgxSelectComponentto move unprojected select items/groups into the scroll container, preserving template order. - Add unit tests covering nested control flow scenarios for both plain items and grouped items.
- Update the sample app to expose a Select sample route and include a demo section reproducing the nested control flow scenario.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/app/select/select.sample.ts |
Adds sample data used by the new nested control-flow select demo. |
src/app/select/select.sample.html |
Adds a demo <igx-select> using @for with nested @if/@else. |
src/app/app.routes.ts |
Registers the Select sample route. |
src/app/app.component.ts |
Adds “Select” to the sample app navigation. |
projects/igniteui-angular/src/lib/select/select.component.ts |
Implements moveItemsToScrollContainer() and invokes it on init and content changes. |
projects/igniteui-angular/src/lib/select/select.component.spec.ts |
Adds coverage for nested control-flow items/groups and dynamic changes. |
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 #
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)