Skip to content

Commit

Permalink
fix: correct offset
Browse files Browse the repository at this point in the history
  • Loading branch information
WX-DongXing committed Mar 4, 2025
1 parent bb4cb7f commit c9cbb80
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
const { ref, cursorSpacing = 0 } = keyboardAvoid.current
setTimeout(() => {
ref?.current?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
const aboveOffset = offset.value + pageY + height - endCoordinates.screenY
const aboveOffset = pageY + height - endCoordinates.screenY
const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing
const belowValue = Math.min(endCoordinates.height, aboveOffset + cursorSpacing)
const value = aboveOffset > 0 ? belowValue : aboveValue
Expand Down

0 comments on commit c9cbb80

Please sign in to comment.