mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
fix(): scroll assist no longer prevents first click event from firing (#22845)
resolves #21871
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { pointerCoord } from '../../helpers';
|
||||
import { pointerCoord, raf } from '../../helpers';
|
||||
|
||||
import { isFocused, relocateInput } from './common';
|
||||
import { getScrollData } from './scroll-data';
|
||||
@ -26,7 +26,6 @@ export const enableScrollAssist = (
|
||||
// focus this input if the pointer hasn't moved XX pixels
|
||||
// and the input doesn't already have focus
|
||||
if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
||||
// begin the input focus process
|
||||
@ -65,6 +64,13 @@ const jsSetFocus = async (
|
||||
relocateInput(componentEl, inputEl, true, scrollData.inputSafeY);
|
||||
inputEl.focus();
|
||||
|
||||
/**
|
||||
* Relocating/Focusing input causes the
|
||||
* click event to be cancelled, so
|
||||
* manually fire one here.
|
||||
*/
|
||||
raf(() => componentEl.click());
|
||||
|
||||
/* tslint:disable-next-line */
|
||||
if (typeof window !== 'undefined') {
|
||||
let scrollContentTimeout: any;
|
||||
|
||||
Reference in New Issue
Block a user