Skip to content

Commit 7002933

Browse files
authored
fix(textarea): update background placement for ionic (#29910)
1 parent 2af2167 commit 7002933

File tree

57 files changed

+76
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+76
-60
lines changed

core/src/components/textarea/test/fill/textarea.e2e.ts

Lines changed: 38 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { expect } from '@playwright/test';
22
import { configs, test } from '@utils/test/playwright';
33

44
/**
5-
* Fill is only available in MD mode
5+
* Fill is only available in MD and Ionic
66
*/
7-
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
7+
configs({ modes: ['md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
88
test.describe(title('textarea: fill'), () => {
99
test.describe('textarea: fill solid', () => {
1010
test('should not have visual regressions', async ({ page }) => {
@@ -13,6 +13,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
1313
<ion-textarea
1414
fill="solid"
1515
label="Email"
16+
label-placement="stacked"
1617
1718
helper-text="Enter your email"
1819
maxlength="20"
@@ -25,49 +26,12 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
2526
const textarea = page.locator('ion-textarea');
2627
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid`));
2728
});
28-
test('should render correctly with floating label', async ({ page }) => {
29-
await page.setContent(
30-
`
31-
<ion-textarea
32-
fill="solid"
33-
label="Email"
34-
label-placement="floating"
35-
36-
helper-text="Enter your email"
37-
maxlength="20"
38-
counter="true"
39-
></ion-textarea>
40-
`,
41-
config
42-
);
43-
44-
const textarea = page.locator('ion-textarea');
45-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
46-
});
47-
test('should not have visual regressions with shaped solid', async ({ page }) => {
48-
await page.setContent(
49-
`
50-
<ion-textarea
51-
shape="round"
52-
fill="solid"
53-
label="Email"
54-
55-
helper-text="Enter your email"
56-
maxlength="20"
57-
counter="true"
58-
></ion-textarea>
59-
`,
60-
config
61-
);
62-
63-
const textarea = page.locator('ion-textarea');
64-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-solid`));
65-
});
66-
test('padding and border radius should be customizable', async ({ page }) => {
29+
test('padding, border radius, and background should be customizable', async ({ page }) => {
6730
await page.setContent(
6831
`
6932
<style>
7033
ion-textarea {
34+
--background: #e5e5e5 !important;
7135
--border-radius: 10px !important;
7236
--padding-start: 50px !important;
7337
--padding-end: 50px !important;
@@ -78,7 +42,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
7842
shape="round"
7943
fill="solid"
8044
label="Email"
81-
label-placement="floating"
45+
label-placement="stacked"
8246
8347
helper-text="Enter your email"
8448
maxlength="20"
@@ -99,6 +63,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
9963
<ion-textarea
10064
fill="outline"
10165
label="Email"
66+
label-placement="stacked"
10267
10368
helper-text="Enter your email"
10469
maxlength="20"
@@ -111,13 +76,23 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
11176
const textarea = page.locator('ion-textarea');
11277
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline`));
11378
});
114-
test('should render correctly with floating label', async ({ page }) => {
79+
test('padding, border radius, and background should be customizable', async ({ page }) => {
11580
await page.setContent(
11681
`
82+
<style>
83+
ion-textarea {
84+
--background: #e5e5e5 !important;
85+
--border-radius: 10px !important;
86+
--padding-start: 50px !important;
87+
--padding-end: 50px !important;
88+
}
89+
</style>
90+
11791
<ion-textarea
92+
shape="round"
11893
fill="outline"
11994
label="Email"
120-
label-placement="floating"
95+
label-placement="stacked"
12196
12297
helper-text="Enter your email"
12398
maxlength="20"
@@ -128,15 +103,25 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
128103
);
129104

130105
const textarea = page.locator('ion-textarea');
131-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
106+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
132107
});
133-
test('should not have visual regressions with shaped outline', async ({ page }) => {
108+
});
109+
});
110+
});
111+
112+
/**
113+
* Fill with floating label is only available in MD mode
114+
*/
115+
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
116+
test.describe(title('textarea: fill'), () => {
117+
test.describe('textarea: fill solid', () => {
118+
test('should render correctly with floating label', async ({ page }) => {
134119
await page.setContent(
135120
`
136121
<ion-textarea
137-
shape="round"
138-
fill="outline"
122+
fill="solid"
139123
label="Email"
124+
label-placement="floating"
140125
141126
helper-text="Enter your email"
142127
maxlength="20"
@@ -147,21 +132,14 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
147132
);
148133

149134
const textarea = page.locator('ion-textarea');
150-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline`));
135+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
151136
});
152-
test('padding and border radius should be customizable', async ({ page }) => {
137+
});
138+
test.describe('textarea: fill outline', () => {
139+
test('should render correctly with floating label', async ({ page }) => {
153140
await page.setContent(
154141
`
155-
<style>
156-
ion-textarea {
157-
--border-radius: 10px !important;
158-
--padding-start: 50px !important;
159-
--padding-end: 50px !important;
160-
}
161-
</style>
162-
163142
<ion-textarea
164-
shape="round"
165143
fill="outline"
166144
label="Email"
167145
label-placement="floating"
@@ -175,7 +153,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
175153
);
176154

177155
const textarea = page.locator('ion-textarea');
178-
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
156+
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
179157
});
180158
});
181159
});
-418 Bytes
-716 Bytes
-282 Bytes
-276 Bytes

0 commit comments

Comments
 (0)