kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.4k stars 55 forks source link

fix: schedule missing layout animations #400

Closed kirillzyusko closed 3 months ago

kirillzyusko commented 3 months ago

πŸ“œ Description

Schedule layout animations on before keyboard appear/disappear.

πŸ’‘ Motivation and Context

Looks like after RN 0.71 the disappear animation happens instantly if user pressed on the ScrollView. I don't know what was exactly broken, but I discovered, that if we schedule LayoutAnimation with keyboard type, then animation happens as it should.

So in this PR I decided to schedule layout animations manually and remove them when keyboard finished its movement.

Theoretically it's a little bit dangerous to schedule global animations, but:

So it's kind of relatively safe πŸ™ƒ

Closes https://github.com/kirillzyusko/react-native-keyboard-controller/issues/307

πŸ“’ Changelog

JS

iOS

πŸ€” How Has This Been Tested?

Tested on iPhone 15 Pro (both paper and fabric).

πŸ“Έ Screenshots (if appropriate):

Before After

πŸ“ Checklist

github-actions[bot] commented 3 months ago

πŸ“Š Package size report

Current size Target Size Difference
130614 bytes 130012 bytes 602 bytes πŸ“ˆ
focux commented 3 months ago

I'm currently experiencing this as well, thank you so much for the fix.

Are these change already on NPM?

kirillzyusko commented 3 months ago

@focux no, not yet - but I hope to publish a new version (1.11.5) in next few hours πŸ‘€