diff options
Diffstat (limited to 'src/view/com/composer/text-input')
-rw-r--r-- | src/view/com/composer/text-input/TextInput.tsx | 5 | ||||
-rw-r--r-- | src/view/com/composer/text-input/TextInput.web.tsx | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/view/com/composer/text-input/TextInput.tsx b/src/view/com/composer/text-input/TextInput.tsx index 11bbf13d2..5d8c49abf 100644 --- a/src/view/com/composer/text-input/TextInput.tsx +++ b/src/view/com/composer/text-input/TextInput.tsx @@ -43,6 +43,7 @@ export interface TextInputRef { interface TextInputProps extends ComponentProps<typeof RNTextInput> { richtext: RichText placeholder: string + webForceMinHeight: boolean setRichText: (v: RichText) => void onPhotoPasted: (uri: string) => void onPressPublish: (richtext: RichText) => void @@ -230,7 +231,7 @@ export const TextInput = forwardRef(function TextInputImpl( }, [t, richtext, inputTextStyle]) return ( - <View style={[a.flex_1, a.pl_md, a.pb_2xl]}> + <View style={[a.flex_1, a.pl_md]}> <PasteInput testID="composerTextInput" ref={textInput} @@ -244,7 +245,7 @@ export const TextInput = forwardRef(function TextInputImpl( allowFontScaling multiline scrollEnabled={false} - numberOfLines={4} + numberOfLines={2} style={[ inputTextStyle, a.w_full, diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx index 1d7908e16..9da220c1b 100644 --- a/src/view/com/composer/text-input/TextInput.web.tsx +++ b/src/view/com/composer/text-input/TextInput.web.tsx @@ -41,6 +41,7 @@ interface TextInputProps { richtext: RichText placeholder: string suggestedLinks: Set<string> + webForceMinHeight: boolean setRichText: (v: RichText | ((v: RichText) => RichText)) => void onPhotoPasted: (uri: string) => void onPressPublish: (richtext: RichText) => void @@ -52,6 +53,7 @@ export const TextInput = React.forwardRef(function TextInputImpl( { richtext, placeholder, + webForceMinHeight, setRichText, onPhotoPasted, onPressPublish, @@ -271,6 +273,13 @@ export const TextInput = React.forwardRef(function TextInputImpl( return style }, [t, fonts]) + React.useLayoutEffect(() => { + let node = editor?.view.dom + if (node) { + node.style.minHeight = webForceMinHeight ? '140px' : '' + } + }, [editor, webForceMinHeight]) + return ( <> <View style={styles.container}> |