Fix iOS Safari sticky input

This commit is contained in:
Eduard Kuzmenko 2022-04-13 22:59:24 +03:00
parent c96ec6b918
commit fba735b0a7

View File

@ -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);
}