Describe the bug
KeyboardExtender component doesn't immediately show its children when enabled prop changes from false to true. There appears to be a delay or the component doesn't render correctly on the first state change, requiring user interaction or additional re-renders to display properly.
Code snippet
import { KeyboardExtender } from 'react-native-keyboard-controller'
const [showExtender, setShowExtender] = useState(false)
useEffect(() => {
if (someValue) {
setShowExtender(true) // This should immediately show the KeyboardExtender
}
}, [someValue])
return (
<KeyboardExtender enabled={showExtender} >
<Banner onPress={onPress} />
</KeyboardExtender>
)
Repo for reproducing
Unfortunately, I cannot provide a public repository due to proprietary code, but the issue occurs in a React Native app with TypeScript using the KeyboardExtender component from react-native-keyboard-controller.
To Reproduce
Steps to reproduce the behavior:
- Initialize KeyboardExtender with
enabled={false}
- Change the
enabled prop to true programmatically (e.g., through useState)
- Observe that the children components inside KeyboardExtender are not immediately visible
- User interaction or additional re-renders are required to make the content appear
Expected behavior
When the enabled prop changes from false to true, the KeyboardExtender should immediately render and display its children components without delay or requiring additional user interaction.
Screenshots
N/A - Visual behavior issue where component simply doesn't appear when expected.
Smartphone (please complete the following information):
- Desktop OS: macOS (Darwin 24.5.0)
- Device: iPhone Simulator & Physical iOS devices
- OS: iOS
- RN version: 0.74.5
- RN architecture: New Architecture (Fabric)
- JS engine: Hermes
- Library version: 1.18.2
Additional context
- The issue seems to be related to the timing of when KeyboardExtender renders its children
- We have applied a patch to add height prop support:
patches/react-native-keyboard-controller+1.18.2.patch
- As a workaround, we implemented animations using react-native-reanimated to provide visual feedback, but the underlying rendering issue with KeyboardExtender remains
- The issue is consistent across different iOS devices and simulators
- Component works correctly after the initial render issue is resolved through user interaction
Describe the bug
KeyboardExtender component doesn't immediately show its children when
enabledprop changes fromfalsetotrue. There appears to be a delay or the component doesn't render correctly on the first state change, requiring user interaction or additional re-renders to display properly.Code snippet
Repo for reproducing
Unfortunately, I cannot provide a public repository due to proprietary code, but the issue occurs in a React Native app with TypeScript using the KeyboardExtender component from react-native-keyboard-controller.
To Reproduce
Steps to reproduce the behavior:
enabled={false}enabledprop totrueprogrammatically (e.g., through useState)Expected behavior
When the
enabledprop changes fromfalsetotrue, the KeyboardExtender should immediately render and display its children components without delay or requiring additional user interaction.Screenshots
N/A - Visual behavior issue where component simply doesn't appear when expected.
Smartphone (please complete the following information):
Additional context
patches/react-native-keyboard-controller+1.18.2.patch