Skip to content

Commit 10d2af3

Browse files
committed
fix(input): fixed label does not have end margin
1 parent 3408223 commit 10d2af3

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

core/src/components/input/input.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@
355355
* on the right in RTL. Label also has a fixed width.
356356
*/
357357
.label-placement-fixed label {
358+
@include margin(0, 0, 0, 0);
359+
358360
flex: 0 0 100px;
359361

360362
width: 100px;

core/src/components/input/test/label-placement/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ <h2>End</h2>
6464
<ion-input value="[email protected]" label="Email" label-placement="end"></ion-input>
6565
</div>
6666

67+
<div class="grid-item">
68+
<h2>Fixed</h2>
69+
<ion-input value="[email protected]" label="Email" label-placement="fixed"></ion-input>
70+
</div>
71+
6772
<div class="grid-item">
6873
<h2>Floating</h2>
6974
<ion-input value="[email protected]" label="Email" label-placement="floating"></ion-input>

core/src/components/input/test/label-placement/input.e2e.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ test.describe('input: label placement end', () => {
2323
});
2424
});
2525

26+
test.describe('input: label placement fixed', () => {
27+
test('label should appear on the starting side of the input and have a fixed width', async ({ page }) => {
28+
await page.setContent(`
29+
<ion-input label="Email" value="[email protected]" label-placement="fixed"></ion-input>
30+
`);
31+
32+
const input = page.locator('ion-input');
33+
expect(await input.screenshot()).toMatchSnapshot(`input-placement-fixed-${page.getSnapshotSettings()}.png`);
34+
});
35+
});
36+
2637
test.describe('input: label placement stacked', () => {
2738
test('label should appear above the input when there is a value', async ({ page }) => {
2839
await page.setContent(`

0 commit comments

Comments
 (0)