refactor(item): do not automatically delegate focus (#29091)

resolves #21982

BREAKING CHANGE:

- Item no longer automatically delegates focus to the first focusable element. While most developers should not need to make any changes to account for this update, usages of `ion-item` with interactive elements such as form controls (inputs, textareas, etc) should be evaluated to verify that interactions still work as expected.
This commit is contained in:
Liam DeBeasi
2024-03-06 16:00:09 +00:00
committed by GitHub
parent 94c3ffcffe
commit 05e721db1c
28 changed files with 181 additions and 87 deletions

View File

@ -45,3 +45,30 @@ configs().forEach(({ title, screenshot, config }) => {
});
});
});
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('textarea: item functionality'), () => {
test('clicking padded space within item should focus the textarea', async ({ page }) => {
await page.setContent(
`
<ion-item>
<ion-textarea label="Textarea"></ion-textarea>
</ion-item>
`,
config
);
const itemNative = page.locator('.item-native');
const textarea = page.locator('ion-textarea textarea');
// Clicks the padded space within the item
await itemNative.click({
position: {
x: 5,
y: 5,
},
});
await expect(textarea).toBeFocused();
});
});
});