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; }