Skip to content

Prevent tooltips from opening inside code blocks #1180

Closed Answered by allan-maeots
allan-maeots asked this question in Q&A
Discussion options

You must be logged in to vote

A hacky version based on the tooltip plugin example could be modifying the update function of tooltipPluginView like that. Not sure yet how bulletproof this is tho..

update: (updatedView, prevState) => {
  const { from } = updatedView.state.selection;
  const { path } = updatedView.state.doc.resolve(from);
  if (!path.find((node) => typeof node === 'object' && node.type.name === 'code_block')) {
    provider.update(updatedView, prevState);
  };
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by allan-maeots
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