Skip to content

Commit

Permalink
Fix initial keyboard animation if prevValue is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
danilvalov committed Nov 11, 2024
1 parent ca4466e commit d6d2d35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GiftedChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ function GiftedChat<TMessage extends IMessage = IMessage> (
useAnimatedReaction(
() => keyboard.height.value,
(value, prevValue) => {
if (prevValue && value !== prevValue) {
if (prevValue !== null && value !== prevValue) {
const isKeyboardMovingUp = value > prevValue
if (isKeyboardMovingUp !== trackingKeyboardMovement.value) {
trackingKeyboardMovement.value = isKeyboardMovingUp
Expand Down

0 comments on commit d6d2d35

Please sign in to comment.