Skip to content

block-draggable caused error when hover over an element #4812

Closed

Description

@AchrafBn

Description

Hello,

when I hover over an element , the onMouseDown method is called and throws this error

Uncaught TypeError: Cannot read properties of undefined (reading 'getNodes')
at onMouseEnter (block-draggable.tsx:289:16)

Reproduction URL

https://github.com/AchrafBn/platejs-test-example/

Reproduction steps

1- type something and hover over it

Plate version

52

Slate React version

I don't use slate

Screenshots

Logs

Browsers

No response

Activity

  1. dosubot commented on Jan 13, 2026

    @dosubot

    The error happens because getNodes is undefined, which usually means the BlockSelectionPlugin is missing from your editor's plugins array or not initialized correctly. Make sure you add BlockSelectionPlugin (or the BlockSelectionKit) to your plugins when creating the editor—this exposes the block selection API that block-draggable relies on. See the setup guide here: BlockSelectionPlugin setup.

    Also, onMouseDown should not be triggered by hover. If it's firing on hover, check your event bindings in block-draggable.tsx to ensure onMouseDown isn't being called from onMouseEnter or onMouseOver by mistake. This could be a misconfiguration or a bug in how the handlers are wired up.

    For drag-and-drop to work, confirm you have @platejs/dnd, react-dnd, and react-dnd-html5-backend installed, DndPlugin added to plugins, and your editor wrapped in a DndProvider using the HTML5 backend. If you use BlockMenuKit, it already includes BlockSelectionPlugin for you.

    If you fix the plugin setup and event bindings, the error should go away. If not, double-check the implementation of block-draggable.tsx for any incorrect event handler assignments.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

    Chat with Dosu Open in Cursor Join Discord Share on X

  2. felixfeng33 commented on Jan 13, 2026

    @felixfeng33
    Collaborator

    Could you provide a reproduction video?

  3. locked and limited conversation to collaborators on Jan 13, 2026
  4. converted this issue into a discussion #4813 on Jan 13, 2026
  5. added theissue type on Oct 26, 2026
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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions