-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Missing infoThe user didn't precise the problem enoughThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOSThis issue is specific to iOS
Description
Description
useAnimatedKeyboard initial value is always zero, even if component mounted when keyboard is opened.
export const AnimatedKeyboardOffset = memo(() => {
const keyboard = useAnimatedKeyboard()
const {bottom: bottomInset} = useSafeAreaInsets()
const heightStyle = useAnimatedStyle(() => {
return {
height: interpolate(keyboard.height.value, [0, bottomInset, 400], [bottomInset, bottomInset, 400]),
}
}, [bottomInset])
// BUG height is zero when component mounts with keyboard opened
return <Animated.View style={heightStyle} />
})
Steps to reproduce
- Mount component when keyboard is opened.
- Hook height value is 0 until you start closing it.
Snack or a link to a repository
Reanimated version
3.4.2
Worklets version
React Native version
0.71.7
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
No response
Device
No response
Host machine
None
Device model
No response
Acknowledgements
Yes
Metadata
Metadata
Assignees
Labels
Missing infoThe user didn't precise the problem enoughThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOSThis issue is specific to iOS