fix: keyboard handler memoization (#6719)
* fix: keyboard handler memoization * fix: return missing dependency
This commit is contained in:
@@ -214,12 +214,15 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
useKeyboardHandler({
|
useKeyboardHandler(
|
||||||
|
{
|
||||||
onEnd: e => {
|
onEnd: e => {
|
||||||
'worklet'
|
'worklet'
|
||||||
runOnJS(setKeyboardHeight)(e.height)
|
runOnJS(setKeyboardHeight)(e.height)
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
[],
|
||||||
|
)
|
||||||
|
|
||||||
const basePading =
|
const basePading =
|
||||||
(isIOS ? 30 : 50) + (isIOS ? keyboardHeight / 4 : keyboardHeight)
|
(isIOS ? 30 : 50) + (isIOS ? keyboardHeight / 4 : keyboardHeight)
|
||||||
|
|||||||
@@ -250,7 +250,8 @@ export function MessagesList({
|
|||||||
// We use this value to keep track of when we want to disable the animation.
|
// We use this value to keep track of when we want to disable the animation.
|
||||||
const layoutScrollWithoutAnimation = useSharedValue(false)
|
const layoutScrollWithoutAnimation = useSharedValue(false)
|
||||||
|
|
||||||
useKeyboardHandler({
|
useKeyboardHandler(
|
||||||
|
{
|
||||||
onStart: e => {
|
onStart: e => {
|
||||||
'worklet'
|
'worklet'
|
||||||
// Immediate updates - like opening the emoji picker - will have a duration of zero. In those cases, we should
|
// Immediate updates - like opening the emoji picker - will have a duration of zero. In those cases, we should
|
||||||
@@ -273,7 +274,9 @@ export function MessagesList({
|
|||||||
'worklet'
|
'worklet'
|
||||||
keyboardIsOpening.set(false)
|
keyboardIsOpening.set(false)
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
[bottomOffset],
|
||||||
|
)
|
||||||
|
|
||||||
const animatedListStyle = useAnimatedStyle(() => ({
|
const animatedListStyle = useAnimatedStyle(() => ({
|
||||||
marginBottom:
|
marginBottom:
|
||||||
|
|||||||
Reference in New Issue
Block a user