Compare commits

...

9 Commits

Author SHA1 Message Date
Shawn Taylor
735d276bf9 Revert snapshot 2023-11-02 12:43:23 -04:00
ionitron
71f7d536b7 chore(): add updated snapshots 2023-11-02 16:05:29 +00:00
Shawn Taylor
da02130b58 Add test for select 2023-11-02 11:36:43 -04:00
Shawn Taylor
8e80779b01 Revert snapshot 2023-11-02 11:29:53 -04:00
ionitron
21eecf06de chore(): add updated snapshots 2023-11-02 14:43:26 +00:00
Shawn Taylor
55be77bf38 Fix test 2023-11-02 10:24:36 -04:00
Shawn Taylor
75cc691497 Add a test 2023-11-02 09:51:28 -04:00
Shawn Taylor
e282058e23 Input: allow label size overrides
Input: allow label size overrides
2023-11-01 09:50:39 -04:00
Shawn Taylor
99f08a9578 Allow label size overrides 2023-10-31 10:00:50 -04:00
10 changed files with 61 additions and 0 deletions

View File

@@ -66,15 +66,20 @@
:host(.input-fill-outline.input-label-placement-stacked) .label-text-wrapper,
:host(.input-fill-outline.input-label-placement-floating) .label-text-wrapper {
@include transform(translateY(-50%), scale(1));
@include transform-origin(start, top);
position: absolute;
top: 50%;
/**
* Label text should not extend
* beyond the bounds of the input.
*/
max-width: calc(100% - var(--padding-start) - var(--padding-end));
transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
top 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
/**
@@ -94,6 +99,7 @@
:host(.input-fill-outline.input-label-placement-stacked) .label-text-wrapper {
@include transform(translateY(-32%), scale(#{$form-control-label-stacked-scale}));
@include margin(0);
top: 0;
/**
* Label text should not extend

View File

@@ -231,4 +231,28 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
await expect(input).toHaveScreenshot(screenshot(`input-label-layering`));
});
});
test.describe(title('input: floating label custom font size'), () => {
test('large label should be centered when field is not focused', async ({ page }, testInfo) => {
testInfo.annotations.push({
type: 'issue',
description: 'https://github.com/ionic-team/ionic-framework/issues/27194',
});
await page.setContent(
`
<ion-input
style="font-size: 30px"
fill="outline"
label="Large floating label"
label-placement="floating"
></ion-input>
`,
config
);
const input = page.locator('ion-input');
await expect(input).toHaveScreenshot(screenshot('input-large-floating-label'));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -79,13 +79,18 @@
:host(.select-fill-outline.select-label-placement-stacked) .label-text-wrapper,
:host(.select-fill-outline.select-label-placement-floating) .label-text-wrapper {
@include transform(translateY(-50%), scale(1));
position: absolute;
top: 50%;
/**
* Label text should not extend
* beyond the bounds of the select.
*/
max-width: calc(100% - var(--padding-start) - var(--padding-end));
transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
top 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
/**
@@ -108,6 +113,7 @@
:host(.select-fill-outline.select-label-placement-stacked) .label-text-wrapper {
@include transform(translateY(-32%), scale(#{$form-control-label-stacked-scale}));
@include margin(0);
top: 0;
/**
* Label text should not extend

View File

@@ -284,7 +284,32 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
await expect(select).toHaveScreenshot(screenshot(`select-label-slot-truncate`));
});
});
test.describe(title('select: floating label custom font size'), () => {
test('large label should be centered when field is not focused', async ({ page }, testInfo) => {
testInfo.annotations.push({
type: 'issue',
description: 'https://github.com/ionic-team/ionic-framework/issues/27194',
});
await page.setContent(
`
<ion-select
style="font-size: 30px"
fill="outline"
label="Large floating label"
label-placement="floating"
></ion-select>
`,
config
);
const input = page.locator('ion-select');
await expect(input).toHaveScreenshot(screenshot('select-label-large-floating'));
});
});
});
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('select: alert label'), () => {
test('should use the label prop to set the default header in an alert', async ({ page }) => {

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB