From abb56d22b4a81d1bc34c689de4ef7218e7503b20 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 11 Aug 2022 10:43:53 -0500 Subject: [PATCH] fix(input): exclude date inputs from scroll assist (#25749) resolves #25745 --- core/src/utils/input-shims/input-shims.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/src/utils/input-shims/input-shims.ts b/core/src/utils/input-shims/input-shims.ts index 89de8dcebd..a83f4776fd 100644 --- a/core/src/utils/input-shims/input-shims.ts +++ b/core/src/utils/input-shims/input-shims.ts @@ -41,7 +41,20 @@ export const startInputShims = (config: Config) => { hideCaretMap.set(componentEl, rmFn); } - if (SCROLL_ASSIST && (!!scrollEl || !!footerEl) && scrollAssist && !scrollAssistMap.has(componentEl)) { + /** + * date/datetime-locale inputs on mobile devices show date picker + * overlays instead of keyboards. As a result, scroll assist is + * not needed. This also works around a bug in iOS <16 where + * scroll assist causes the browser to lock up. See FW-1997. + */ + const isDateInput = inputEl.type === 'date' || inputEl.type === 'datetime-local'; + if ( + SCROLL_ASSIST && + !isDateInput && + (!!scrollEl || !!footerEl) && + scrollAssist && + !scrollAssistMap.has(componentEl) + ) { const rmFn = enableScrollAssist(componentEl, inputEl, scrollEl, footerEl, keyboardHeight); scrollAssistMap.set(componentEl, rmFn); }