Skip to content

fix(input-group): update theme classes after a runtime theme change - #18058

Open
onlyexeption wants to merge 2 commits into
masterfrom
ibarakov/fix-17991
Open

onlyexeption wants to merge 2 commits into
masterfrom
ibarakov/fix-17991

Conversation

@onlyexeption

Copy link
Copy Markdown
Contributor

Closes #17991

Description

IgxInputGroupComponent now stores its theme in a private signal instead of a plain field. After a runtime THEME_TOKEN change, 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 public theme input 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, a type="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's ngAfterViewInit. A signal read in the host bindings refreshes the parent view in both cases. IgxActionStripComponent (_hidden) and IgxExpansionPanelComponent (_collapsed) already use the same approach.

Not in this PR: igx-icon has a similar stale host class after switching to or from Indigo. It will get a separate issue.

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

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?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Two new tests in input-group.component.spec.ts use an input group in an OnPush host:

  • The theme changes through THEME_TOKEN: fails on master.
  • The parent sets the theme in ngAfterViewInit: fails on master, and also with only a markForCheck().

The issue's steps (default token, --ig-theme from Bootstrap to Material, igx-combo type="border" in an OnPush component) leave the classes stale on master with zone.js and update them with this change.

Also run, all passing:

  • the input group, combo, simple combo, picker, select, icon, drop-down, autocomplete and input directive specs (1012 tests)
  • the grid cell editing, row editing and filtering specs (491 tests)
  • a production build of the library
  • npm run lint:lib (0 errors)

Test Configuration:

  • Angular version: 22.2.3
  • Browser(s): Chromium (Vitest browser mode)
  • OS: Windows 11

Screenshots / Recordings

See the screenshots in #17991.

Checklist:

  • All relevant labels have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

@onlyexeption onlyexeption added ❌ status: awaiting-test PRs awaiting manual verification input-group labels Nov 25, 2026
Copilot AI balanced review requested due to automatic review settings November 25, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

input-group ❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input group keeps the host classes of its first theme after a runtime theme change

2 participants