Skip to content

Commit

Permalink
fix(offset): fix offset issue with android
Browse files Browse the repository at this point in the history
  • Loading branch information
EQuimper committed Jun 14, 2024
1 parent 50e5e7a commit 3584025
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ export function useFormSmartScroll({
_keyboard.coordinates.end.screenY - currentFocus.height * 2
) {
if (wrapperOffset) {
return -currentFocus.height;
const diff = Math.abs(
_keyboard.coordinates.end.screenY -
currentFocus.position -
currentFocus.height -
padding +
scrollY.value -
wrapperOffset
);
return -diff;
}

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

0 comments on commit 3584025

Please sign in to comment.