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;
|
2023-04-18 12:46:53 +00:00
|
|
|
children: React.ReactElement[] | React.ReactElement;
|
2022-04-13 20:43:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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}
|
|
|
|
>
|
2022-04-13 20:43:56 +00:00
|
|
|
{children}
|
|
|
|
</KeyboardAwareScrollView>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default KeyboardView;
|