Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
KeroZhai opened this issue Sep 19, 2024 · 2 comments
Open
1 task done
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@KeroZhai
Copy link

KeroZhai commented Sep 19, 2024

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

  • Yes, I've updated all my dependencies.
@KeroZhai KeroZhai added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Sep 19, 2024
@gethari
Copy link
Contributor

gethari commented Sep 23, 2024

image

I could'nt able to see the suggestion popup inside inlineCode , am I missing something ?

@KeroZhai
Copy link
Author

KeroZhai commented Sep 23, 2024

Only spaces are allowed before the @, so in your case it won't trigger the popup.

Just using the provided example:

recording

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Triage open
Development

No branches or pull requests

2 participants