Overview
One of the reasons the drag and drop is a bit fiddly is because elements are moving around the page as components are being dragged. We should avoid this type of shifts until the actual drop has happened to make the whole experience a bit less chaotic.

Proposed resolution
Retain space components take when drag on a component starts. Effects used to show where component gets placed should also not take space from the page.
User interface changes

| Comment | File | Size | Author |
|---|---|---|---|
| #8 | xb-drag-retain-space-ghost.gif | 3.67 MB | balintbrews |
| #6 | ghost component at drop target.gif | 276.48 KB | wim leers |
| CleanShot 2024-08-23 at 14.46.55.gif | 534.79 KB | lauriii |
Issue fork experience_builder-3469895
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
Comment #2
gauravvvv commentedComment #4
gauravvvv commentedComment #5
lauriiiThis is a really nice improvement! Thank you @gauravvvv!
Comment #6
wim leersI think this is indeed a clear improvement:

Assigning to @balintbrews for final review 😄
Comment #8
balintbrewsThis looks amazing! 🤩
I added a small commit to address two minor things:
What would be nice, and I couldn't quickly find the selector for it, is to hide the name of a newly added component inside the ghost element. See on my screen capture. @gauravvvv, would you be up for taking a stab at that? If we can't easily make it happen, let's center that element inside the ghost wrapper for now, so it looks like it's intentionally there. You can do that by adding:
Comment #9
balintbrewsComment #10
wim leersComment #11
lauriiiI'm wondering if we should just land this regardless of #8? I think we need a follow-up to improve the design for the scenario where a new component is being added anyway because I think we can improve it further than what's proposed in #8.
Comment #12
balintbrews@lauriii, sure, that's why I proposed the fallback solution that makes things better immediately. 🙂 Let me push that commit quickly, then we can wrap this up.
Comment #13
balintbrewsComment #14
lauriiiThis looks good! We probably need couple more issues to further refine this but this is a big step forward 👍
Comment #16
wim leers