Skip to content

Commit a7233c2

Browse files
fix(input): remove z-index target-area for ionic theme (#30261)
Issue number: internal --------- ## What is the current behavior? Currently, operations associated with gestures aren’t working, for the ionic theme: - can’t select the text using double tap - can’t longpress - can’t move the cursor to any positions ## What is the new behavior? - It's now possible to select text using double tap, long press and move the cursor to different positions - Adds new tests for double clicks | Before | Now | |--------|-----| |![prev](https://github.com/user-attachments/assets/c1c54710-e534-44bf-9ef9-6ddc990996d9) | ![now](https://github.com/user-attachments/assets/b10b8696-e0bb-4e99-9d3d-fe5a92d384e8) | ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Notes Currently, the double click text selection is not working (the text isn't selected) on the automated tests for: - ionic theme, on firefox and safari - md/ios themes, on firefox as manual tests do not have this problem, we'll be skipping these tests for now and come back to them at a later date --------- Co-authored-by: Maria Hutt <[email protected]>
1 parent 40932d7 commit a7233c2

File tree

34 files changed

+55
-3
lines changed

34 files changed

+55
-3
lines changed

core/src/components/input/input.ionic.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@
6565

6666
// Cursor should match the native input when hovering over the target area.
6767
cursor: text;
68-
69-
z-index: 1;
7068
}
7169

7270
::slotted([slot="start"]),

core/src/components/input/test/basic/input.e2e.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ configs().forEach(({ title, screenshot, config }) => {
2929
await expect(input).toHaveScreenshot(screenshot(`input-with-placeholder`));
3030
});
3131
});
32-
3332
test.describe('input with clear button', () => {
3433
test('should not have visual regressions with default label', async ({ page }) => {
3534
await page.setContent(
@@ -63,6 +62,43 @@ configs().forEach(({ title, screenshot, config }) => {
6362
await expect(input).toHaveScreenshot(screenshot(`input-with-clear-button-stacked`));
6463
});
6564
});
65+
test.describe('input click behaviors', () => {
66+
test('should not have visual regressions when user double clicks', async ({ page }) => {
67+
await page.setContent(
68+
`
69+
<ion-input
70+
label="Label"
71+
clear-input="true"
72+
value="Text"
73+
></ion-input>
74+
`,
75+
config
76+
);
77+
const input = page.locator('ion-input');
78+
const nativeInput = input.locator('input');
79+
await nativeInput.dblclick();
80+
// Validates the display of an input with a clear button.
81+
await expect(input).toHaveScreenshot(screenshot(`input-dbclick`));
82+
});
83+
test('should not have visual regressions with stacked label when user double clicks', async ({ page }) => {
84+
await page.setContent(
85+
`
86+
<ion-input
87+
label="Label"
88+
label-placement="stacked"
89+
clear-input="true"
90+
value="Text"
91+
></ion-input>
92+
`,
93+
config
94+
);
95+
const input = page.locator('ion-input');
96+
const nativeInput = input.locator('input');
97+
await nativeInput.dblclick();
98+
// Validates the display of an input with a clear button.
99+
await expect(input).toHaveScreenshot(screenshot(`input-dbclick-stacked`));
100+
});
101+
});
66102
});
67103
});
68104

@@ -185,6 +221,24 @@ configs({ modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
185221
const container = page.locator('#container');
186222
await expect(container).toHaveScreenshot(screenshot(`input-clear-button-focused`));
187223
});
224+
225+
test('should not have visual regressions when user double clicks', async ({ page }) => {
226+
await page.setContent(
227+
`
228+
<ion-input
229+
label="Label"
230+
label-placement="stacked"
231+
clear-input="true"
232+
value="Text"
233+
></ion-input>
234+
`,
235+
config
236+
);
237+
const input = page.locator('ion-input');
238+
const nativeInput = input.locator('input');
239+
await nativeInput.dblclick();
240+
await expect(input).toHaveScreenshot(screenshot(`input-dbclick`));
241+
});
188242
});
189243
});
190244

2.67 KB
Loading
3.22 KB
Loading
2.85 KB
Loading
2.67 KB
Loading
3.2 KB
Loading
2.87 KB
Loading
2.34 KB
Loading
2.51 KB
Loading

0 commit comments

Comments
 (0)