Skip to content

Commit

Permalink
fix: fix label color in disabled state (#6838) (#6848)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Vinogradov <[email protected]>
  • Loading branch information
vaadin-bot and vursen authored Nov 24, 2023
1 parent d69a98a commit ef26e31
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ describe('checkbox-group', () => {
await visualDiff(div, 'label-focused');
});

it('label disabled', async () => {
element.label = 'Label';
element.disabled = true;
await visualDiff(div, 'label-disabled');
});

it('value', async () => {
element.value = ['a', 'c'];
await visualDiff(div, 'value');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ describe('checkbox-group', () => {
await visualDiff(div, 'label-focused');
});

it('label disabled', async () => {
element.label = 'Label';
element.disabled = true;
await visualDiff(div, 'label-disabled');
});

it('value', async () => {
element.value = ['a', 'c'];
await visualDiff(div, 'value');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions packages/radio-group/test/visual/lumo/radio-group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ describe('radio-group', () => {
await visualDiff(div, 'label-focused');
});

it('label disabled', async () => {
element.label = 'Label';
element.disabled = true;
await visualDiff(div, 'label-disabled');
});

it('value', async () => {
element.value = 'a';
await visualDiff(div, 'value');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions packages/radio-group/test/visual/material/radio-group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ describe('radio-group', () => {
await visualDiff(div, 'label-focused');
});

it('label disabled', async () => {
element.label = 'Label';
element.disabled = true;
await visualDiff(div, 'label-disabled');
});

it('value', async () => {
element.value = 'a';
await visualDiff(div, 'value');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/radio-group/theme/lumo/vaadin-radio-group-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const radioGroup = css`
flex-direction: column;
}
:host([disabled]) [part='label'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
}
:host([focused]:not([readonly])) [part='label'] {
color: var(--lumo-primary-text-color);
}
Expand Down

0 comments on commit ef26e31

Please sign in to comment.