diff --git a/core/src/components/searchbar/searchbar.tsx b/core/src/components/searchbar/searchbar.tsx index 887d3a47f58..8b352c7f185 100644 --- a/core/src/components/searchbar/searchbar.tsx +++ b/core/src/components/searchbar/searchbar.tsx @@ -243,14 +243,9 @@ export class Searchbar implements ComponentInterface { /** * Clears the input field and triggers the control change. */ - private onClearInput = (ev?: Event, shouldFocus?: boolean) => { + private onClearInput = (shouldFocus?: boolean) => { this.ionClear.emit(); - if (ev) { - ev.preventDefault(); - ev.stopPropagation(); - } - // setTimeout() fixes https://github.com/ionic-team/ionic/issues/7527 // wait for 4 frames setTimeout(() => { @@ -533,8 +528,15 @@ export class Searchbar implements ComponentInterface { type="button" no-blur class="searchbar-clear-button" - onMouseDown={(ev) => this.onClearInput(ev, true)} - onTouchStart={(ev) => this.onClearInput(ev, true)} + onPointerDown={(ev) => { + /** + * This prevents mobile browsers from + * blurring the input when the clear + * button is activated. + */ + ev.preventDefault(); + }} + onClick={() => this.onClearInput(true)} >