2022-04-13 20:43:56 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
|
|
|
|
2022-06-06 14:17:51 +00:00
|
|
|
import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps';
|
2022-04-13 20:43:56 +00:00
|
|
|
|
|
|
|
interface IKeyboardViewProps extends KeyboardAwareScrollViewProps {
|
|
|
|
keyboardVerticalOffset?: number;
|
|
|
|
scrollEnabled?: boolean;
|
|
|
|
children: React.ReactElement[] | React.ReactElement;
|
|
|
|
}
|
|
|
|
|
|
|
|
const KeyboardView = ({ style, contentContainerStyle, scrollEnabled, keyboardVerticalOffset, children }: IKeyboardViewProps) => (
|
|
|
|
<KeyboardAwareScrollView
|
|
|
|
{...scrollPersistTaps}
|
|
|
|
style={style}
|
|
|
|
contentContainerStyle={contentContainerStyle}
|
|
|
|
scrollEnabled={scrollEnabled}
|
|
|
|
alwaysBounceVertical={false}
|
2022-08-08 21:02:08 +00:00
|
|
|
extraHeight={keyboardVerticalOffset}
|
|
|
|
>
|
2023-03-01 21:10:05 +00:00
|
|
|
{children}
|
2022-04-13 20:43:56 +00:00
|
|
|
</KeyboardAwareScrollView>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default KeyboardView;
|