Replies: 4 comments
-
|
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 |
Beta Was this translation helpful? Give feedback.
-
|
Could you provide a reproduction video? |
Beta Was this translation helpful? Give feedback.
-
|
The error happens because BlockSelectionPlugin is missing or not initialized in your Plate editor plugins, so block-draggable can't access getNodes and crashes on hover. Make sure you add BlockSelectionPlugin (or BlockSelectionKit) to your plugins array—this exposes the block selection API that block-draggable needs. See the BlockSelectionPlugin setup guide. 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. 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. Fixing the plugin setup and event bindings should resolve the error. If not, double-check 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 |
Beta Was this translation helpful? Give feedback.
-
Screen.Recording.2026-01-13.at.15.45.39.mov |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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 itPlate version
52
Slate React version
I don't use slate
Screenshots
Logs
Browsers
No response
Beta Was this translation helpful? Give feedback.
All reactions