fix(dialog): fix on-screen keyboard overlapping dialog boxes
This commit is contained in:
parent
8b454b5196
commit
39853e048b
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
Text,
|
Text,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
TouchableWithoutFeedback,
|
TouchableWithoutFeedback,
|
||||||
|
@ -16,6 +17,7 @@ import AbstractDialog, {
|
||||||
type State
|
type State
|
||||||
} from '../AbstractDialog';
|
} from '../AbstractDialog';
|
||||||
import { brandedDialog as styles } from './styles';
|
import { brandedDialog as styles } from './styles';
|
||||||
|
import { Platform } from '../../../react';
|
||||||
|
|
||||||
export type Props = AbstractProps & {
|
export type Props = AbstractProps & {
|
||||||
|
|
||||||
|
@ -53,7 +55,8 @@ class BaseDialog<P: Props, S: State> extends AbstractDialog<P, S> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableWithoutFeedback>
|
<TouchableWithoutFeedback>
|
||||||
<View
|
<KeyboardAvoidingView
|
||||||
|
behavior = { Platform.OS === 'ios' ? 'padding' : 'height' }
|
||||||
style = { [
|
style = { [
|
||||||
styles.overlay,
|
styles.overlay,
|
||||||
style
|
style
|
||||||
|
@ -73,7 +76,7 @@ class BaseDialog<P: Props, S: State> extends AbstractDialog<P, S> {
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{ this._renderContent() }
|
{ this._renderContent() }
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</KeyboardAvoidingView>
|
||||||
</TouchableWithoutFeedback>
|
</TouchableWithoutFeedback>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue