fix(scroll-padding): correct padding is added (#26810)

resolves #26803
This commit is contained in:
Liam DeBeasi
2023-02-22 15:29:07 -05:00
committed by GitHub
parent f006e4bc09
commit eefd17d492

View File

@ -75,7 +75,7 @@ const jsSetFocus = async (
* see the page jump.
*/
if (enableScrollPadding && contentEl !== null) {
currentPadding += scrollData.scrollAmount;
currentPadding += scrollData.scrollPadding;
setScrollPadding(contentEl, currentPadding);
setClearScrollPaddingListener(inputEl, contentEl, () => (currentPadding = 0));
}
@ -103,7 +103,7 @@ const jsSetFocus = async (
* the keyboard.
*/
if (enableScrollPadding && contentEl) {
currentPadding += scrollData.scrollAmount;
currentPadding += scrollData.scrollPadding;
setScrollPadding(contentEl, currentPadding);
}