Replace text in selection #4622
Replies: 1 comment
-
const selection = $getSelection();
if ($isRangeSelection(selection)) {
selection.insertText(newText);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fantactuka
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given a piece of selected text, how do I replace only the selection with another piece of text? The selection would be part of a TextNode
Beta Was this translation helpful? Give feedback.
All reactions