Skip to content

Commit 0855cfe

Browse files
Jexsier0ssing
andauthored
fix: wrap FormplayerModal in KeyboardAvoidingView to fix whitespace bug (#585)
Prevents the known layout bug where focusing an input field in the Formplayer WebView causes the window to compress and flash a white block directly above the keyboard. Signed-off-by: Jessie Ssebuliba <jessiessebuliba@gmail.com> Co-authored-by: Emil Rossing <emil@rossing.org>
1 parent 9d82fa7 commit 0855cfe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

formulus/src/components/FormplayerModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Text,
1515
Platform,
1616
ActivityIndicator,
17+
KeyboardAvoidingView,
1718
} from 'react-native';
1819
import CustomAppWebView, {
1920
CustomAppWebViewHandle,
@@ -614,7 +615,9 @@ const FormplayerModal = forwardRef<FormplayerModalHandle, FormplayerModalProps>(
614615
onRequestClose={handleClose}
615616
presentationStyle="fullScreen"
616617
statusBarTranslucent={false}>
617-
<View style={shellStyle}>
618+
<KeyboardAvoidingView
619+
style={shellStyle}
620+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}>
618621
<View
619622
style={[
620623
styles.container,
@@ -681,7 +684,7 @@ const FormplayerModal = forwardRef<FormplayerModalHandle, FormplayerModalProps>(
681684
</View>
682685
)}
683686
</View>
684-
</View>
687+
</KeyboardAvoidingView>
685688
</Modal>
686689
);
687690
},

0 commit comments

Comments
 (0)