Skip to content

Commit 245fa31

Browse files
authored
Merge pull request #455 from SharePickle/bugfix/rich-text-link
Fixed RichText link removing selected text.
2 parents 4c559fe + 981ea7e commit 245fa31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/controls/richText/RichText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ id="DropDownStyles"
689689
quill.deleteText(range.index, range.length);
690690
}
691691

692-
if (cursorPosition) {
692+
if (cursorPosition > -1) {
693693
const textToInsert: string = this.state.insertUrlText !== undefined ? this.state.insertUrlText : this.state.insertUrl;
694694
const urlToInsert: string = this.state.insertUrl;
695695
quill.insertText(cursorPosition, textToInsert);

0 commit comments

Comments
 (0)