Repository navigation
fix(input-group): update theme classes after a runtime theme change - #18058
Open
onlyexeption wants to merge 2 commits into
Open
onlyexeption wants to merge 2 commits into
onlyexeption wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the runtime theme synchronization change.
No open issues 🎉
What changed in this PR
Fixes #17991 by keeping input-group theme classes synchronized with its template after runtime theme changes, including inside OnPush views. The public theme input remains unchanged.
Changes:
- Replaces private theme storage with a signal so theme-dependent host bindings refresh.
- Adds regression tests for token changes and theme restoration in a parent’s
ngAfterViewInit. - Documents the fix in the changelog.
| File | Description |
|---|---|
projects/igniteui-angular/input-group/src/input-group/input-group.component.ts |
Uses signal-backed theme state in getters and host bindings. |
projects/igniteui-angular/input-group/src/input-group/input-group.component.spec.ts |
Adds two OnPush runtime-theme regression tests. |
CHANGELOG.md |
Records the theme-class synchronization fix. |
Review effort: Balanced
This branch has not been deployed
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 #17991
Description
IgxInputGroupComponentnow stores its theme in a private signal instead of a plain field. After a runtimeTHEME_TOKENchange, its theme host classes (--border,--bootstrap, and the others) update together with its template, also when the input group is in an OnPush view. The publicthemeinput is unchanged.Motivation / Context
Host bindings are evaluated in the parent's view. The token subscription called only
this.cdr.detectChanges(). That refreshes the input group's own template (the notch appears) but not an OnPush parent, so the host kept the classes of the first theme. In the Combo docs sample, atype="border"combo lost its outline and its value ran under the icons.A
markForCheck()alone isn't enough. It's lost when the theme is set while change detection runs, for example a saved theme restored in a parent'sngAfterViewInit. A signal read in the host bindings refreshes the parent view in both cases.IgxActionStripComponent(_hidden) andIgxExpansionPanelComponent(_collapsed) already use the same approach.Not in this PR:
igx-iconhas a similar stale host class after switching to or from Indigo. It will get a separate issue.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Input Group, and through it Combo, Simple Combo, Date Picker, Date Range Picker, Time Picker, Select, and the grid cell editors and filter row.
How Has This Been Tested?
Two new tests in
input-group.component.spec.tsuse an input group in an OnPush host:THEME_TOKEN: fails onmaster.ngAfterViewInit: fails onmaster, and also with only amarkForCheck().The issue's steps (default token,
--ig-themefrom Bootstrap to Material,igx-combo type="border"in an OnPush component) leave the classes stale onmasterwith zone.js and update them with this change.Also run, all passing:
npm run lint:lib(0 errors)Test Configuration:
Screenshots / Recordings
See the screenshots in #17991.
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)