Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix initial keyboard animation if prevValue is 0 #2553

Conversation

danilvalov
Copy link
Contributor

After adding support for bottomOffset I found some case on iOS:

When we first open the keyboard on iOS we skip the animation logic because prevValue is 0:

 value 260
 prevValue 0
 // (prevValue && value !== prevValue) is false

We don't see this issue on Android, as the keyboard gets a bunch of values ​​when first opened:

 value 0
 prevValue 0
 // (prevValue && value !== prevValue) is false
 value 18
 prevValue 0
 // (prevValue && value !== prevValue) is false
 value 50
 prevValue 18
 // (prevValue && value !== prevValue) is true

(all of these triggers above are triggered on first press)

prevValue can be null or a number, and I couldn't understand why we check prevValue instead of prevValue !== null, so I changed this condition.

@kesha-antonov kesha-antonov merged commit 8f61eb3 into FaridSafi:master Jan 9, 2025
2 checks passed
@danilvalov danilvalov deleted the fix/allow-non-null-prev-value-for-keyboard-animation branch January 14, 2025 13:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants