From e579ed9be7563cb51c8624e5d32e841497fcd8f9 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Wed, 19 Aug 2020 16:08:00 -0400 Subject: [PATCH 1/2] fix(input): adjust scroll to include the accessory bar on iOS fixes #21912 --- core/src/utils/input-shims/hacks/scroll-assist.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/utils/input-shims/hacks/scroll-assist.ts b/core/src/utils/input-shims/hacks/scroll-assist.ts index 939987afb04..9c245ec52f5 100644 --- a/core/src/utils/input-shims/hacks/scroll-assist.ts +++ b/core/src/utils/input-shims/hacks/scroll-assist.ts @@ -1,4 +1,5 @@ import { pointerCoord } from '../../helpers'; +import { isPlatform } from '../../platform'; import { isFocused, relocateInput } from './common'; import { getScrollData } from './scroll-data'; @@ -95,6 +96,11 @@ const jsSetFocus = async ( window.addEventListener('ionKeyboardDidShow', scrollContent); }; + if (isPlatform('ios')) { + // Add 30px to account for the "Accessory" bar + scrollData.scrollAmount += 30; + } + if (contentEl) { const scrollEl = await contentEl.getScrollElement(); From 2c75535bd0b255ce9aadb9040556d3dd686f6af1 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 26 Aug 2020 17:25:51 +0000 Subject: [PATCH 2/2] fix scroll assist for accessory bar and tabs --- core/src/utils/input-shims/hacks/scroll-assist.ts | 6 ------ core/src/utils/input-shims/hacks/scroll-data.ts | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/core/src/utils/input-shims/hacks/scroll-assist.ts b/core/src/utils/input-shims/hacks/scroll-assist.ts index 9c245ec52f5..939987afb04 100644 --- a/core/src/utils/input-shims/hacks/scroll-assist.ts +++ b/core/src/utils/input-shims/hacks/scroll-assist.ts @@ -1,5 +1,4 @@ import { pointerCoord } from '../../helpers'; -import { isPlatform } from '../../platform'; import { isFocused, relocateInput } from './common'; import { getScrollData } from './scroll-data'; @@ -96,11 +95,6 @@ const jsSetFocus = async ( window.addEventListener('ionKeyboardDidShow', scrollContent); }; - if (isPlatform('ios')) { - // Add 30px to account for the "Accessory" bar - scrollData.scrollAmount += 30; - } - if (contentEl) { const scrollEl = await contentEl.getScrollElement(); diff --git a/core/src/utils/input-shims/hacks/scroll-data.ts b/core/src/utils/input-shims/hacks/scroll-data.ts index 4ea4e7d5c74..649609db533 100644 --- a/core/src/utils/input-shims/hacks/scroll-data.ts +++ b/core/src/utils/input-shims/hacks/scroll-data.ts @@ -34,7 +34,7 @@ const calcScrollData = ( // compute safe area const safeAreaTop = visibleAreaTop + 15; - const safeAreaBottom = visibleAreaBottom - 15; + const safeAreaBottom = visibleAreaBottom * 0.75; // figure out if each edge of the input is within the safe area const distanceToBottom = safeAreaBottom - inputBottom;