From c6e26c8765b8e12eb293275455de106888305852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Tue, 16 Jul 2024 12:43:07 +0200 Subject: [PATCH] fix(web): onChange event start negative --- src/MarkdownTextInput.web.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 7581e9a6..a73a1287 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -418,7 +418,7 @@ const MarkdownTextInput = React.forwardRef( if (inputType === 'deleteContentBackward') { // When the user does a backspace delete he expects the content before the cursor to be removed. // For this the start value needs to be adjusted (its as if the selection was before the text that we want to delete) - start -= before; + start = Math.max(start - before, 0); } event.nativeEvent.count = count;