tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

[Bug]: `isActive` not returning lastest result in `Suggestion.allow` method

Open KeroZhai opened this issue 5 months ago • 2 comments

Affected Packages

Core, Suggestion

Version(s)

2.7.1

Bug Description

I don't want to trigger suggestions in inline code, so I write this:

suggestion: {
  allow: ({ editor }) => {
    return !editor.isActive('code')
  }
}

However, this is not working. It turns out that the result of isActive is incorrect, it returns the state of last cursor location.

Browser Used

Edge

Code Example URL

https://codesandbox.io/p/devbox/stoic-lumiere-p2s5s8

Expected Behavior

isActive returns current state.

Additional Context (Optional)

No response

Dependency Updates

  • [X] Yes, I've updated all my dependencies.

KeroZhai avatar Sep 19 '24 07:09 KeroZhai