fix(item): prevent slotted form controls from taking whole width of item (#26897)

This commit is contained in:
Amanda Johnston
2023-03-06 11:34:52 -06:00
committed by GitHub
parent 7bc22f2bbf
commit 78f5d960cf
36 changed files with 130 additions and 16 deletions

View File

@ -188,67 +188,67 @@
<ion-content>
<ion-list>
<ion-item>
<ion-toggle slot="end" enable-on-off-labels="true">Unchecked</ion-toggle>
<ion-toggle enable-on-off-labels="true">Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" enable-on-off-labels="true" checked>Checked</ion-toggle>
<ion-toggle enable-on-off-labels="true" checked>Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="secondary" enable-on-off-labels="true">Secondary Unchecked</ion-toggle>
<ion-toggle color="secondary" enable-on-off-labels="true">Secondary Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="secondary" enable-on-off-labels="true" checked>Secondary Checked</ion-toggle>
<ion-toggle color="secondary" enable-on-off-labels="true" checked>Secondary Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="success" enable-on-off-labels="true">Success Unchecked</ion-toggle>
<ion-toggle color="success" enable-on-off-labels="true">Success Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="success" enable-on-off-labels="true" checked>Success Checked</ion-toggle>
<ion-toggle color="success" enable-on-off-labels="true" checked>Success Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="danger" enable-on-off-labels="true">Danger Unchecked</ion-toggle>
<ion-toggle color="danger" enable-on-off-labels="true">Danger Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="danger" enable-on-off-labels="true" checked>Danger Checked</ion-toggle>
<ion-toggle color="danger" enable-on-off-labels="true" checked>Danger Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="tertiary" enable-on-off-labels="true">Tertiary Unchecked</ion-toggle>
<ion-toggle color="tertiary" enable-on-off-labels="true">Tertiary Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="tertiary" enable-on-off-labels="true" checked>Tertiary Checked</ion-toggle>
<ion-toggle color="tertiary" enable-on-off-labels="true" checked>Tertiary Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="light" enable-on-off-labels="true">Light Unchecked</ion-toggle>
<ion-toggle color="light" enable-on-off-labels="true">Light Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="light" enable-on-off-labels="true" checked>Light Checked</ion-toggle>
<ion-toggle color="light" enable-on-off-labels="true" checked>Light Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="medium" enable-on-off-labels="true">Medium Unchecked</ion-toggle>
<ion-toggle color="medium" enable-on-off-labels="true">Medium Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="medium" enable-on-off-labels="true" checked>Medium Checked</ion-toggle>
<ion-toggle color="medium" enable-on-off-labels="true" checked>Medium Checked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="dark" enable-on-off-labels="true">Dark Unchecked</ion-toggle>
<ion-toggle color="dark" enable-on-off-labels="true">Dark Unchecked</ion-toggle>
</ion-item>
<ion-item>
<ion-toggle slot="end" color="dark" enable-on-off-labels="true" checked>Dark Checked</ion-toggle>
<ion-toggle color="dark" enable-on-off-labels="true" checked>Dark Checked</ion-toggle>
</ion-item>
</ion-list>
</ion-content>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -43,6 +43,11 @@
height: 100%;
}
:host(.in-item[slot="start"]:not(.legacy-toggle)),
:host(.in-item[slot="end"]:not(.legacy-toggle)) {
width: auto;
}
:host(.legacy-toggle) {
contain: content;
}