Skip to content

Commit

Permalink
Merge pull request #2553 from danilvalov/fix/allow-non-null-prev-valu…
Browse files Browse the repository at this point in the history
…e-for-keyboard-animation

Fix initial keyboard animation if `prevValue` is `0`
  • Loading branch information
kesha-antonov authored Jan 9, 2025
2 parents e34a141 + d6d2d35 commit 8f61eb3
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 @@ -568,7 +568,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 8f61eb3

Please sign in to comment.