Skip to content

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

Open

Description

@IMinchev64

Description

When the theme is changed at runtime through THEME_TOKEN, an igx-input-group inside an OnPush component (for example igx-combo) updates its template but keeps the host classes of the theme it was first rendered in. With a Material stylesheet and Bootstrap host classes, a type="border" input loses its outline, and its value runs under the suffix icons.

The token subscription in input-group.component.ts calls only this.cdr.detectChanges(). That refreshes the component's own view, but host bindings belong to the parent's view, and an OnPush parent such as igx-combo is not marked dirty, so they are not refreshed. A later change detection of the parent, such as ng.applyChanges on the combo, corrects the classes.

Framework

Angular

Angular Version

22.3.0

Ignite UI for Angular Version

igniteui-angular 22.3.0-alpha.0. master has the same code

Component / Area

Input Group

Browser

Chrome

Operating System

Windows

Command Not Working

Steps to Reproduce

  1. Use the default THEME_TOKEN (no explicit token value, so preferToken is false). Load the Bootstrap stylesheet and set the token to bootstrap.
  2. Render an igx-combo with type="border".
  3. Load the Material stylesheet and call themeToken.set('material').

Actual Result

The input group's template switches to Material: the notch is rendered. Its host classes still read igx-input-group--bootstrap, and igx-input-group--border is missing.

Expected Result

The host classes follow the new theme: igx-input-group--border, and no igx-input-group--bootstrap.

Reproduction URL

(waiting for new combo samples so I can link it directly)

Attachments

image image

IgniteUI/igniteui-documentation#1032 (comment)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions