Skip to content

Closing suggestions programmatically can trigger other #7585

@oBusk

Description

@oBusk

Affected Packages

suggestion

Version(s)

3.20.1

Bug Description

Trying to write code to close suggestion when editor is blurred, a behaviour I feel like could be the default, I ran into an issue where it was closed but then immidiately opened. I realized this was because exitSuggestion(editor.view, pluginKeyA) would trigger the findSuggestionMatch code for pluginKeyB

So I was calling exitSuggestion() multiple times to make sure all potential suggestions were closed, and after closing A, when I called exit on B, it triggered findSuggestionMatch() for the first one and opened it again.

Browser Used

Firefox

Code Example URL

https://codesandbox.io/p/devbox/reverent-neumann-cx4nrg?workspaceId=ws_VrZDLHe5kHRsi7kpJ6PqyE

Expected Behavior

I expect that triggering exitSuggestion() for another suggestion should not count as a triggering transaction

Additional Context (Optional)

This is trying to use the API introduced in #6833

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions