Skip to content

Commit 2d1efdb

Browse files
authored
perf(input): passive event listener for touch start events (#25610)
Resolves #25599
1 parent fe757c3 commit 2d1efdb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

core/src/components/input/input.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ export class Input implements ComponentInterface {
496496
aria-label="reset"
497497
type="button"
498498
class="input-clear-icon"
499-
onTouchStart={this.clearTextInput}
500-
onMouseDown={this.clearTextInput}
499+
onPointerDown={this.clearTextInput}
501500
onKeyDown={this.clearTextOnEnter}
502501
/>
503502
)}

core/src/utils/input-shims/hacks/scroll-assist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const enableScrollAssist = (
3131
jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight);
3232
}
3333
};
34-
componentEl.addEventListener('touchstart', touchStart, true);
34+
componentEl.addEventListener('touchstart', touchStart, { capture: true, passive: true });
3535
componentEl.addEventListener('touchend', touchEnd, true);
3636

3737
return () => {

0 commit comments

Comments
 (0)