diff --git a/src/helpers/dom/fixSafariStickyInput.ts b/src/helpers/dom/fixSafariStickyInput.ts index 3d1c4b21..7aefe5ae 100644 --- a/src/helpers/dom/fixSafariStickyInput.ts +++ b/src/helpers/dom/fixSafariStickyInput.ts @@ -4,6 +4,8 @@ * https://github.com/morethanwords/tweb/blob/master/LICENSE */ +import { doubleRaf } from "../schedulers"; + export default function fixSafariStickyInput(input: HTMLElement) { input.style.transform = 'translateY(-99999px)'; /* input.style.position = 'fixed'; @@ -11,7 +13,8 @@ export default function fixSafariStickyInput(input: HTMLElement) { input.style.left = '0'; */ input.focus(); - setTimeout(() => { + // setTimeout(() => { + doubleRaf().then(() => { //fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4, undefined, FocusDirection.Static); /* input.style.position = ''; input.style.top = ''; */ @@ -21,5 +24,6 @@ export default function fixSafariStickyInput(input: HTMLElement) { /* setTimeout(() => { fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4); }, 50); */ - }, 0); + }); + // }, 0); }