From 95e428c58ad724c35732c7142b4f3289e91f0b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Wed, 11 Sep 2024 16:43:29 +0200 Subject: [PATCH] Fix entering space on FireFox --- src/MarkdownTextInput.web.tsx | 3 ++- src/web/MarkdownTextInput.css | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 4d1f8786..8c4cf140 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -176,10 +176,11 @@ const MarkdownTextInput = React.forwardRef( flattenedStyle && { caretColor: (flattenedStyle as TextStyle).color || 'black', }, + multiline && {whitespace: 'pre-wrap'}, disabled && styles.disabledInputStyles, parseToReactDOMStyle(flattenedStyle), ]) as CSSProperties, - [flattenedStyle, disabled], + [flattenedStyle, multiline, disabled], ); const undo = useCallback( diff --git a/src/web/MarkdownTextInput.css b/src/web/MarkdownTextInput.css index 24decc91..a8ad3bae 100644 --- a/src/web/MarkdownTextInput.css +++ b/src/web/MarkdownTextInput.css @@ -3,6 +3,10 @@ overflow: auto; } +.react-native-live-markdown-input-multiline { + white-space: pre-wrap; +} + .react-native-live-markdown-input-singleline p { display: inline-block; }