mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(input): exclude date inputs from scroll assist (#25749)
resolves #25745
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user