Skip to content

Commit

Permalink
fix: restore 100% width on group field container (#2887)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Oct 18, 2021
1 parent 48fbfd6 commit 99b87df
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/checkbox-group/src/vaadin-checkbox-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class CheckboxGroup extends FieldMixin(FocusMixin(DisabledMixin(DirMixin(Themabl
.vaadin-group-field-container {
display: flex;
flex-direction: column;
width: 100%;
}
:host(:not([has-label])) [part='label'] {
Expand Down
12 changes: 12 additions & 0 deletions packages/checkbox-group/test/visual/lumo/checkbox-group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ describe('checkbox-group', () => {
element.style.width = '150px';
await visualDiff(div, 'wrapped');
});

it('full width', async () => {
div.style.width = '300px';
div.style.padding = '0';
element.style.width = '100%';
element.querySelectorAll('vaadin-checkbox').forEach((checkbox) => {
checkbox.style.width = '33%';
// compensate inline-block whitespace
checkbox.style.marginRight = '-3px';
});
await visualDiff(div, 'full-width');
});
});

describe('RTL', () => {
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 @@ -77,6 +77,18 @@ describe('checkbox-group', () => {
element.style.width = '150px';
await visualDiff(div, 'wrapped');
});

it('full width', async () => {
div.style.width = '300px';
div.style.padding = '0';
element.style.width = '100%';
element.querySelectorAll('vaadin-checkbox').forEach((checkbox) => {
checkbox.style.width = '33%';
// compensate inline-block whitespace
checkbox.style.marginRight = '-3px';
});
await visualDiff(div, 'full-width');
});
});

describe('RTL', () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/radio-group/src/vaadin-radio-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class RadioGroup extends FieldMixin(FocusMixin(DisabledMixin(KeyboardMixin(DirMi
.vaadin-group-field-container {
display: flex;
flex-direction: column;
width: 100%;
}
:host(:not([has-label])) [part='label'] {
Expand Down
12 changes: 12 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 @@ -87,6 +87,18 @@ describe('radio-group', () => {
element.style.width = '150px';
await visualDiff(div, 'wrapped');
});

it('full width', async () => {
div.style.width = '300px';
div.style.padding = '0';
element.style.width = '100%';
element.querySelectorAll('vaadin-radio-button').forEach((radio) => {
radio.style.width = '33%';
// compensate inline-block whitespace
radio.style.marginRight = '-3px';
});
await visualDiff(div, 'full-width');
});
});

describe('RTL', () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 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 @@ -77,6 +77,18 @@ describe('radio-group', () => {
element.style.width = '150px';
await visualDiff(div, 'wrapped');
});

it('full width', async () => {
div.style.width = '300px';
div.style.padding = '0';
element.style.width = '100%';
element.querySelectorAll('vaadin-radio-button').forEach((radio) => {
radio.style.width = '33%';
// compensate inline-block whitespace
radio.style.marginRight = '-3px';
});
await visualDiff(div, 'full-width');
});
});

describe('RTL', () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 99b87df

Please sign in to comment.