Skip to content

Commit f7d4c21

Browse files
authored
fix(): scroll assist no longer prevents first click event from firing (#22845)
resolves #21871
1 parent fa515eb commit f7d4c21

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pointerCoord } from '../../helpers';
1+
import { pointerCoord, raf } from '../../helpers';
22

33
import { isFocused, relocateInput } from './common';
44
import { getScrollData } from './scroll-data';
@@ -26,7 +26,6 @@ export const enableScrollAssist = (
2626
// focus this input if the pointer hasn't moved XX pixels
2727
// and the input doesn't already have focus
2828
if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {
29-
ev.preventDefault();
3029
ev.stopPropagation();
3130

3231
// begin the input focus process
@@ -65,6 +64,13 @@ const jsSetFocus = async (
6564
relocateInput(componentEl, inputEl, true, scrollData.inputSafeY);
6665
inputEl.focus();
6766

67+
/**
68+
* Relocating/Focusing input causes the
69+
* click event to be cancelled, so
70+
* manually fire one here.
71+
*/
72+
raf(() => componentEl.click());
73+
6874
/* tslint:disable-next-line */
6975
if (typeof window !== 'undefined') {
7076
let scrollContentTimeout: any;

0 commit comments

Comments
 (0)