Skip to content

Commit

Permalink
Merge pull request #455 from SharePickle/bugfix/rich-text-link
Browse files Browse the repository at this point in the history
Fixed RichText link removing selected text.
  • Loading branch information
AJIXuMuK committed Jan 10, 2020
2 parents 4c559fe + 981ea7e commit 245fa31
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 245fa31

Please sign in to comment.