From 981ea7ef1680ea8757c7f2148cb059e5d2460926 Mon Sep 17 00:00:00 2001 From: Alexander Kleshcheov Date: Thu, 9 Jan 2020 17:22:59 +0300 Subject: [PATCH] Fixed RichText link removing selected text. --- src/controls/richText/RichText.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/richText/RichText.tsx b/src/controls/richText/RichText.tsx index 8b05663b3..9e0b42f1d 100644 --- a/src/controls/richText/RichText.tsx +++ b/src/controls/richText/RichText.tsx @@ -689,7 +689,7 @@ id="DropDownStyles" quill.deleteText(range.index, range.length); } - if (cursorPosition) { + if (cursorPosition > -1) { const textToInsert: string = this.state.insertUrlText !== undefined ? this.state.insertUrlText : this.state.insertUrl; const urlToInsert: string = this.state.insertUrl; quill.insertText(cursorPosition, textToInsert);