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!

CommentFileSizeAuthor
before-after.png228.04 KBjessebaker
2024-11-06 16.16.25.gif1.11 MBjessebaker
Command icon 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:

Comments

jessebaker created an issue. See original summary.

longwave’s picture

Assigned: Unassigned » longwave

My bad, this broke in a refactor of the preview rendering in #3475584: Add support for Blocks as Components - will fix.

longwave’s picture

Status: Active » Needs review

Added 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?

longwave’s picture

Assigned: longwave » Unassigned
jessebaker’s picture

Status: Needs review » Reviewed & tested by the community

  • jessebaker committed 355530a9 on 0.x authored by longwave
    Issue #3485937 by longwave: Drag and drop in the preview not working...
jessebaker’s picture

Status: Reviewed & tested by the community » Fixed

longwave’s picture

Status: Fixed » Needs review

@tedbow pointed out that if you start with an entirely blank page then drag and drop fails following this commit, fixed in the followup.

longwave changed the visibility of the branch 3485937-drag-and-drop to hidden.

longwave’s picture

Refactored 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.

tedbow’s picture

Status: Needs review » Reviewed & tested by the community

Test manually and it works now

reviewed the code and also looks good

  • tedbow committed 270f7603 on 0.x authored by longwave
    Issue #3485937 by longwave, jessebaker: Drag and drop in the preview not...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed
tedbow’s picture

I think if had this #3474257: Create an E2E test that starts with an empty canvas we would have caught this bug

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.