handle KeyboardAvoid #517
Unanswered
hoangman1108
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have problem with enable scrollable, with new update version 3.8.2. the sheet always detents=[1]
Anyway to handle the button with keyboard avoid
`
const buttonTranslateY = useSharedValue(0)
const keyboardHeight = useSharedValue(0)
useKeyboardHandler(
{
onMove: (e) => {
"worklet"
keyboardHeight.value = e.height
buttonTranslateY.value = -e.height / 2 - (e.height > 100 ? height.value : 0)
},
onEnd: (e) => {
"worklet"
keyboardHeight.value = e.height
buttonTranslateY.value = -e.height / 2 - (e.height > 100 ? height.value : 0)
},
},
[]
)
const buttonAnimatedStyle = useAnimatedStyle(() => ({
transform: [{ translateY: buttonTranslateY.value }],
paddingBottom: keyboardHeight.value > 0 ? bottom : 0,
}))
const keyboardPadding = useAnimatedStyle(() => ({
height: height.value,
}))
return (
<SimpleBottomSheet closeFromController={handleClose} header={t("feedback.title")} isVisible={isVisible} scrollable>
<View style={[$styles.px[16], $styles.pt[16], $styles.gap[24]]}>
<Text color="neutralStrong" preset="lg/semibold" style={$titleStyle} text={t("feedback.sendToTeam")} />
<Text color="neutralMedium" preset="xs/medium" text={t("feedback.subtitle")} />
)
}
`
Beta Was this translation helpful? Give feedback.
All reactions