Skip to content

Commit b92e3eb

Browse files
authored
fix(web): onChange event start negative (#433)
1 parent ae487c7 commit b92e3eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MarkdownTextInput.web.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
418418
if (inputType === 'deleteContentBackward') {
419419
// When the user does a backspace delete he expects the content before the cursor to be removed.
420420
// For this the start value needs to be adjusted (its as if the selection was before the text that we want to delete)
421-
start -= before;
421+
start = Math.max(start - before, 0);
422422
}
423423

424424
event.nativeEvent.count = count;

0 commit comments

Comments
 (0)