0

I am using draft-js-plugins. This library does not have to change the font or font size. I need that when a text is selected it changes its font and size to the one selected. As in google docs. To select the text I am using GetSelection properties:

  const selectionState = editorState.getSelection();
  const anchorKey = selectionState.getAnchorKey();
  const currentContent = editorState.getCurrentContent();
  const currentContentBlock = currentContent.getBlockForKey(anchorKey);
  const start = selectionState.getStartOffset();
  const end = selectionState.getEndOffset();
  const selectedText = currentContentBlock.getText().slice(start, end);

I need to change the style to that selection. Thanks!

Agustin R
  • 47
  • 6

0 Answers0