Skip to content

Commit 3584025

Browse files
committed
fix(offset): fix offset issue with android
1 parent 50e5e7a commit 3584025

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Provider.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,15 @@ export function useFormSmartScroll({
141141
_keyboard.coordinates.end.screenY - currentFocus.height * 2
142142
) {
143143
if (wrapperOffset) {
144-
return -currentFocus.height;
144+
const diff = Math.abs(
145+
_keyboard.coordinates.end.screenY -
146+
currentFocus.position -
147+
currentFocus.height -
148+
padding +
149+
scrollY.value -
150+
wrapperOffset
151+
);
152+
return -diff;
145153
}
146154

147155
return -Math.abs(currentFocus.height / 4);

0 commit comments

Comments
 (0)