change the scrollPersistTap
This commit is contained in:
parent
da62dcb214
commit
1f26b82d20
|
@ -1,9 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
||||||
import { Keyboard, Pressable } from 'react-native';
|
|
||||||
|
|
||||||
import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps';
|
import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps';
|
||||||
import sharedStyles from '../views/Styles';
|
|
||||||
|
|
||||||
interface IKeyboardViewProps extends KeyboardAwareScrollViewProps {
|
interface IKeyboardViewProps extends KeyboardAwareScrollViewProps {
|
||||||
keyboardVerticalOffset?: number;
|
keyboardVerticalOffset?: number;
|
||||||
|
@ -20,13 +18,7 @@ const KeyboardView = ({ style, contentContainerStyle, scrollEnabled, keyboardVer
|
||||||
alwaysBounceVertical={false}
|
alwaysBounceVertical={false}
|
||||||
extraHeight={keyboardVerticalOffset}
|
extraHeight={keyboardVerticalOffset}
|
||||||
>
|
>
|
||||||
{/** Use Pressable instead of TouchableWithoutFeedback, because the TouchableWithoutFeedback requires a view wrapping the children
|
{children}
|
||||||
* and this wrapping is causing wrong behavior on ScrollView
|
|
||||||
* https://stackoverflow.com/a/74456534
|
|
||||||
* */}
|
|
||||||
<Pressable style={sharedStyles.container} onPress={() => Keyboard.dismiss()}>
|
|
||||||
{children}
|
|
||||||
</Pressable>
|
|
||||||
</KeyboardAwareScrollView>
|
</KeyboardAwareScrollView>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
import { KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
||||||
|
|
||||||
const scrollPersistTaps: Partial<KeyboardAwareScrollViewProps> = {
|
const scrollPersistTaps: Partial<KeyboardAwareScrollViewProps> = {
|
||||||
keyboardShouldPersistTaps: 'always',
|
keyboardShouldPersistTaps: 'handled',
|
||||||
keyboardDismissMode: 'interactive'
|
keyboardDismissMode: 'interactive'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue