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.62k stars 67 forks source link

fix: react on `enabled` property toggle when keyboard open (`KeyboardAwareScrollView`) #417

Closed kirillzyusko closed 5 months ago

kirillzyusko commented 5 months ago

πŸ“œ Description

React on enabled property toggle when keyboard open in KeyboardAwareScrollView component.

πŸ’‘ Motivation and Context

Initially me and @IvanIhnatsiuk were thinking that in https://github.com/kirillzyusko/react-native-keyboard-controller/pull/350 it will be better to not handle keyboard appearance if enabled=false. But it turns out that it will produce issues like https://github.com/kirillzyusko/react-native-keyboard-controller/issues/414

So in this PR I'm always keeping a handler in useKeyboardHandler hook and instead I don't render additional padding if view is disabled (we are not making any scrolling because we already handle enabled property value in maybeScroll).

Fixes https://github.com/kirillzyusko/react-native-keyboard-controller/issues/414

πŸ“’ Changelog

JS

πŸ€” How Has This Been Tested?

Tested manually on iPhone 15 Pro (iOS 17.4, simulator).

πŸ“Έ Screenshots (if appropriate):

Before After
image image

πŸ“ Checklist

github-actions[bot] commented 5 months ago

πŸ“Š Package size report

Current size Target Size Difference
127142 bytes 127209 bytes -67 bytes πŸ“‰