Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/components/KeyboardAvoidingView/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import {KeyboardAvoidingView as RNKeyboardAvoidingView} from 'react-native';
import PropTypes from 'prop-types';

/**
* Android-specific KeyboardAvoidingView to handle landscape layout shifts
* and ensure inputs remain visible when the keyboard is active.
*/
function KeyboardAvoidingView({children, style, ...props}) {
return (
<RNKeyboardAvoidingView
behavior="padding"
keyboardVerticalOffset={0}
style={[{flex: 1}, style]}
{...props}
>
{children}
</RNKeyboardAvoidingView>
);
}

KeyboardAvoidingView.propTypes = {
children: PropTypes.node.isRequired,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
};

KeyboardAvoidingView.defaultProps = {
style: {},
};

export default KeyboardAvoidingView;
Loading