Skip to content

Commit

Permalink
Fixed RichText link removing selected text.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAccelerator committed Jan 9, 2020
1 parent 5cf8856 commit 981ea7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controls/richText/RichText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 981ea7e

Please sign in to comment.