diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index e7edead7..f363f9cf 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -300,7 +300,7 @@ const MarkdownTextInput = React.forwardRef( return; } - const isContained = CursorUtils.restrictRanges(divRef.current, value ?? ''); + const isContained = CursorUtils.restrictRanges(divRef.current, (divRef.current as HTMLInputElement)?.value ?? ''); const newSelection = predefinedSelection && isContained ? predefinedSelection : CursorUtils.getCurrentCursorPosition(divRef.current); if (newSelection && (!contentSelection.current || contentSelection.current.start !== newSelection.start || contentSelection.current.end !== newSelection.end)) {