Overview
It's currently not possible to drag and drop components in between other components - only to the very top or bottom of the page.
Proposed resolution
It seems the change is a result of the introduction of an extra div wrapping the components in the root.

Can't drop in between!

| Comment | File | Size | Author |
|---|---|---|---|
| before-after.png | 228.04 KB | jessebaker | |
| 2024-11-06 16.16.25.gif | 1.11 MB | jessebaker |
Issue fork experience_builder-3485937
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3485937-drag-and-drop-v2
changes, plain diff MR !407
- 3485937-drag-and-drop
changes, plain diff MR !400
Comments
Comment #2
longwaveMy bad, this broke in a refactor of the preview rendering in #3475584: Add support for Blocks as Components - will fix.
Comment #4
longwaveAdded a PHP test to ensure that the preview output contains at least the basic elements required here, but it feels like this maybe should also have a Cypress test if possible?
Comment #5
longwaveComment #6
jessebaker commentedComment #8
jessebaker commentedComment #10
longwave@tedbow pointed out that if you start with an entirely blank page then drag and drop fails following this commit, fixed in the followup.
Comment #12
longwaveRefactored the recursion in wrapComponentsForPreview() to be simpler to follow - we no longer need to pass the UUID around - and improved the test coverage to check all levels of the response, though we could still do more here.
Comment #13
tedbowTest manually and it works now
reviewed the code and also looks good
Comment #15
tedbowComment #16
tedbowI think if had this #3474257: Create an E2E test that starts with an empty canvas we would have caught this bug