diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index b2feb40a..ea94c0e7 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -241,10 +241,7 @@ const MarkdownTextInput = React.forwardRef { if (!contentSelection.current || contentSelection.current.end - contentSelection.current.start < 1) { - return { - text: '', - cursorPosition: 0, - }; + throw new Error('[react-native-live-markdown] invalid selection'); } const selectedText = parsedText.slice(contentSelection.current.start, contentSelection.current.end);