mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-26 09:14:22 +08:00
fix: workaround keyboard dismissing on focus
closes #8414, closes #8478
This commit is contained in:
@@ -493,14 +493,19 @@ export default class Card extends React.Component<Props> {
|
||||
? Color(backgroundColor).alpha() === 0
|
||||
: false;
|
||||
|
||||
// This is a dummy style that doesn't actually change anything visually.
|
||||
// Animated needs the animated value to be used somewhere, otherwise things don't update properly.
|
||||
// If we disable animations and hide header, it could end up making the value unused.
|
||||
// So we have this dummy style that will always be used regardless of what else changed.
|
||||
const dummyStyle = { opacity: Animated.diffClamp(current, 1, 1) };
|
||||
|
||||
return (
|
||||
<CardAnimationContext.Provider value={animationContext}>
|
||||
<Animated.View
|
||||
style={{
|
||||
// This is a dummy style that doesn't actually change anything visually.
|
||||
// Animated needs the animated value to be used somewhere, otherwise things don't update properly.
|
||||
// If we disable animations and hide header, it could end up making the value unused.
|
||||
// So we have this dummy style that will always be used regardless of what else changed.
|
||||
opacity: current,
|
||||
}}
|
||||
// Make sure that this view isn't removed. If this view is removed, our style with animated value won't apply
|
||||
collapsable={false}
|
||||
/>
|
||||
<View pointerEvents="box-none" {...rest}>
|
||||
{overlayEnabled ? (
|
||||
<View pointerEvents="box-none" style={StyleSheet.absoluteFill}>
|
||||
@@ -508,15 +513,8 @@ export default class Card extends React.Component<Props> {
|
||||
</View>
|
||||
) : null}
|
||||
<Animated.View
|
||||
style={[
|
||||
styles.container,
|
||||
dummyStyle,
|
||||
containerStyle,
|
||||
customContainerStyle,
|
||||
]}
|
||||
style={[styles.container, containerStyle, customContainerStyle]}
|
||||
pointerEvents="box-none"
|
||||
// Make sure that this view isn't removed. If this view is removed, our style with animated value won't apply which will cause values to be incorrect
|
||||
collapsable={false}
|
||||
>
|
||||
<PanGestureHandler
|
||||
enabled={layout.width !== 0 && gestureEnabled}
|
||||
|
||||
Reference in New Issue
Block a user