fix(input): clear button uses contrast when setting color on item (#26592)

resolves #26337
This commit is contained in:
Liam DeBeasi
2023-01-17 11:07:08 -05:00
committed by GitHub
parent 911b1d496e
commit a31e1e594d
9 changed files with 20 additions and 4 deletions

View File

@@ -185,7 +185,7 @@ test.describe('input: clear button', () => {
*/
test('should keep the input focused when the clear button is pressed', async ({ page }) => {
await page.setContent(`
<ion-input value="abc" clear-input="true"></ion-searchbar>
<ion-input value="abc" clear-input="true"></ion-input>
`);
const input = page.locator('ion-input');
@@ -200,4 +200,17 @@ test.describe('input: clear button', () => {
await expect(nativeInput).toBeFocused();
});
test('should inherit color when used in item with color property', async ({ page }) => {
await page.setContent(`
<ion-item color="primary">
<ion-input value="Text" clear-input="true"></ion-input>
</ion-item>
`);
const item = page.locator('ion-item');
expect(await item.screenshot()).toMatchSnapshot(
`input-with-clear-button-item-color-${page.getSnapshotSettings()}.png`
);
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB