Skip to content

Commit

Permalink
fix(core/chip): applied inactive state to host (#1683)
Browse files Browse the repository at this point in the history
Co-authored-by: Demirci <ridvan.demirci@siemens.com>
Co-authored-by: Daniel Leroux <daniel.leroux@siemens.com>
Co-authored-by: AndreasBerliner <41509230+AndreasBerliner@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 13, 2025
1 parent 5b56d90 commit aa63b4f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/brave-jeans-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siemens/ix": patch
---

`active=false` of the `ix-chip` will now show the chip as not interactable.

Fixed #1656
3 changes: 3 additions & 0 deletions packages/core/src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export class Chip {
<Host
tabIndex="-1"
title={this.hostElement.textContent}
class={{
inactive: isInactive,
}}
style={
this.variant === 'custom'
? {
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/components/chip/test/chip.ct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { test } from '@utils/test';
import { expect } from '@playwright/test';
import { test } from '@utils/test';

test('renders', async ({ mount, page }) => {
await mount(`<ix-chip></ix-chip>`);
Expand Down Expand Up @@ -52,3 +52,9 @@ test.describe('chip test', () => {
expect(normalChipSize.width).toEqual(outlineChipSize.width);
});
});

test('check inactive class', async ({ mount, page }) => {
await mount(`<ix-chip active="false">test</ix-chip>`);
const chip = page.locator('ix-chip');
await expect(chip).toHaveClass('inactive hydrated');
});

0 comments on commit aa63b4f

Please sign in to comment.