Skip to content

Image toolbar disappears instantly in Safari when the mouse leaves the image area #2541

Closed

Description

@orzup

What’s broken?

In Safari, the Image block toolbar disappears instantly when the mouse leaves the image, making it impossible to click the buttons. This works fine in Chrome and Firefox.

What did you expect to happen?

The toolbar should stay visible while the image is selected so users can move their mouse to the buttons.

Steps to reproduce

  1. Use Safari and open BlockNote( https://www.blocknotejs.org/demo ).
  2. Insert an image.
  3. Click the image to show the toolbar.
  4. Move the mouse toward the toolbar. It disappears immediately upon leaving the image area.
2026-03-05.mp4

BlockNote version

No response

Environment

Safari 26.2, macOS Tahoe 26

Additional context

No response

Contribution

  • I'd be interested in contributing a fix for this issue

Sponsor

  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖 (Business)

Activity

  1. added
    needs-triage
    on Mar 5, 2026
  2. YousefED commented on Mar 5, 2026

    @YousefED
    Collaborator

    Thanks @orzup , we'll look into this. As what company are you sponsoring btw?

  3. added
    bug:P2
    sponsor
    and removed
    needs-triage
    on Mar 5, 2026
  4. orzup commented on Mar 6, 2026

    @orzup
    Author

    Thanks for the quick response!

    I'm with SAKURA Internet Inc., and our Business Plan is registered under the project name "eureco".
    If you need the registered email address for verification, please let me know the best way to send it to you privately.

    Looking forward to the fix!

  5. YousefED commented on Mar 6, 2026

    @YousefED
    Collaborator

    Thanks. We aim to resolve it later this month!

  6. bnscde commented on Mar 30, 2026

    @bnscde

    Root cause for the disappearing image toolbar seems to be a side effect of a known WebKit behavior where mutating the DOM tree near a selected node causes the selection to collapse.

    In BlockNote, the resize handles for images are added/removed from the DOM on every mouseenter/mouseleave. This mutation triggers Safari to drop the NodeSelection, making the toolbar vanish instantly.

    I've created a patch that switches the resize handles to use opacity: 0/1 instead of physical DOM removal as workaround. This keeps the DOM tree stable and fixes the selection issue in Safari. You can use it via npx patch-package until we get an official solution.

    @blocknote+core+0.47.3.patch

  7. matthewlipski commented on Mar 30, 2026

    @matthewlipski
    Collaborator

    Hi @bnscde , seems like this is the right approach. However, I didn't manage to find anything concrete documenting the Safari behaviour of collapsing the selection on DOM mutation. Do you have any links to this you could provide?

  8. orzup commented on Apr 3, 2026

    @orzup
    Author

    Thanks for the fix! It's working great now. 🙏✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:P2sponsor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions