BUG: Blocks stop being draggable after switching page when nativeDnD is false
- Dominant language
- TypeScript
- Stars
- 26.2k
- Forks
- 4.6k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 6
Description
### GrapesJS version
- [X] I confirm to use the latest version of GrapesJS
Tested with GrapesJS 0.23.6, the latest release. `BlocksView` has the same code in 0.23.2 and on the `dev` branch.
### What browser are you using?
Chromium 141, and WebKitGTK (Tauri webview)
### Reproducible demo link
https://codepen.io/lexoyo/pen/01a0a971-906e-7d70-94d8-69d9672dd680
### Describe the bug
Found in [Silex Desktop](https://www.silex.me/ai/), where I need to turn off native drag because WebKit webviews do not support HTML5 drag and drop across iframes.
**How to reproduce the bug?**
1. Init the editor with `nativeDnD: false` and two pages.
2. Drag a block into the first page. It works.
3. Select the second page.
4. Drag a block. Nothing happens, and no error is raised.
5. Go back to the first page. Dragging still does nothing.
**What is the expected behavior?**
Dragging a block works on every page, and keeps working after a page change.
**What is the current behavior?**
Dragging a block does nothing as soon as another page has been selected, on every page, with nothing in the console.
Contributor guide
Research direction
Reproduce the issue from the linked CodePen with nativeDnD: false and two pages, then inspect BlocksView and the page-selection lifecycle. Trace what changes after selecting another page and verify that block dragging remains functional on every page after the fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100