diff --git a/core/src/components/searchbar/searchbar.md.scss b/core/src/components/searchbar/searchbar.md.scss index b8c6f06ecd..341e9e433c 100644 --- a/core/src/components/searchbar/searchbar.md.scss +++ b/core/src/components/searchbar/searchbar.md.scss @@ -34,7 +34,13 @@ // ----------------------------------------- .searchbar-cancel-button { - @include position(0, null, null, 5px); + /** + * The left edge of the cancel button + * should align with the left edge + * of the back button if the searchbar + * is used in a toolbar. + */ + @include position(0, null, null, 9px); background-color: $searchbar-md-cancel-button-background-color; diff --git a/core/src/components/searchbar/searchbar.md.vars.scss b/core/src/components/searchbar/searchbar.md.vars.scss index a764fe4123..0af1072dc2 100644 --- a/core/src/components/searchbar/searchbar.md.vars.scss +++ b/core/src/components/searchbar/searchbar.md.vars.scss @@ -25,7 +25,7 @@ $searchbar-md-cancel-button-color: $text-color-step-100 !default; $searchbar-md-cancel-button-background-color: transparent !default; /// @prop - Font size of the searchbar cancel button -$searchbar-md-cancel-button-font-size: 1.6em !default; +$searchbar-md-cancel-button-font-size: 1.5em !default; /// @prop - Color of the searchbar input search icon $searchbar-md-input-search-icon-color: $text-color-step-400 !default; diff --git a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Chrome-linux.png b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Chrome-linux.png index 7d8e177b54..b59ef65300 100644 Binary files a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Firefox-linux.png b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Firefox-linux.png index 8f81b057d9..76b1d0844f 100644 Binary files a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Safari-linux.png b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Safari-linux.png index 3f7c19d3cd..cad88f11c7 100644 Binary files a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Safari-linux.png and b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Chrome-linux.png b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Chrome-linux.png index 545bfbf9f1..2d51b54c67 100644 Binary files a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Firefox-linux.png b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Firefox-linux.png index 4b25be63a6..1ad1fef1a7 100644 Binary files a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Safari-linux.png b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Safari-linux.png index b9dcb46427..2080cab6c6 100644 Binary files a/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Safari-linux.png and b/core/src/components/searchbar/test/a11y/searchbar.e2e.ts-snapshots/searchbar-scale-toolbar-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts b/core/src/components/searchbar/test/basic/searchbar.e2e.ts index 325b4a9bb4..bde8167637 100644 --- a/core/src/components/searchbar/test/basic/searchbar.e2e.ts +++ b/core/src/components/searchbar/test/basic/searchbar.e2e.ts @@ -198,3 +198,33 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c }); }); }); + +configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { + test.describe(title('searchbar: cancel button alignment'), () => { + test('should align with the back button when used in a toolbar', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/28468', + }); + await page.setContent( + ` + + + + + + Test + + + + + + `, + config + ); + + const header = page.locator('ion-header'); + await expect(header).toHaveScreenshot(screenshot(`searchbar-back-button-align`)); + }); + }); +}); diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Chrome-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..83e873e9cf Binary files /dev/null and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Firefox-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..2cf11d416a Binary files /dev/null and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Safari-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..fc1fe62107 Binary files /dev/null and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-back-button-align-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Chrome-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Chrome-linux.png index c291883de6..e17b903fa2 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Firefox-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Firefox-linux.png index 01e29c0963..5a32452b48 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Safari-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Safari-linux.png index dbc9964de9..9b7b2bb008 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Safari-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Chrome-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Chrome-linux.png index b1579bb496..90c1b2e054 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Chrome-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Chrome-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Firefox-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Firefox-linux.png index 262da58c0c..a470b7a3e7 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Firefox-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Firefox-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Safari-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Safari-linux.png index 817fdbb717..745740cd1a 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Safari-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-buttons-md-rtl-Mobile-Safari-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Chrome-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Chrome-linux.png index 1dea3e2dfc..81262fc909 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Firefox-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Firefox-linux.png index a901e3dd54..cbfbf26407 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Safari-linux.png b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Safari-linux.png index 593540ec84..be7a89f1a3 100644 Binary files a/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Safari-linux.png and b/core/src/components/searchbar/test/basic/searchbar.e2e.ts-snapshots/searchbar-color-md-ltr-Mobile-Safari-linux.png differ