mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
perf(all): improve scroll assist responsiveness (#20987)
resolves #20922
This commit is contained in:
@ -70,6 +70,7 @@ const jsSetFocus = (
|
||||
clearTimeout(scrollContentTimeout);
|
||||
}
|
||||
window.removeEventListener('resize', scrollContent);
|
||||
window.removeEventListener('keyboardWillShow', scrollContent);
|
||||
|
||||
// scroll the input into place
|
||||
await contentEl.scrollByPoint(0, scrollData.scrollAmount, scrollData.scrollDuration);
|
||||
@ -83,9 +84,10 @@ const jsSetFocus = (
|
||||
};
|
||||
|
||||
window.addEventListener('resize', scrollContent);
|
||||
window.addEventListener('keyboardWillShow', scrollContent);
|
||||
|
||||
// fallback in case resize never fires
|
||||
scrollContentTimeout = setTimeout(scrollContent, 1000);
|
||||
scrollContentTimeout = setTimeout(scrollContent, 300);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user