Skip to content

How to disallow some shortcuts for RichTextPlugin? E.g. cmd + u #5868

Closed Answered by buondevid
buondevid asked this question in Q&A
Discussion options

You must be logged in to vote

Investigated a bit more and ended up on this solution:

  /* Disable underline formatting */
  useEffect(() => {
    editor.registerCommand(
      FORMAT_TEXT_COMMAND,
      (event) => {
        if (['underline'].includes(event)) {
          return true;
        }
        return false;
      },
      4,
    );
  }, [editor]);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by buondevid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant