invent-framework / invent

Express yourself with code.
https://invent-framework.github.io/
Apache License 2.0
109 stars 13 forks source link

In UI designer, as elements are dragged into the UI, "ghost" preview the position of the dragged element. #116

Open ntoll opened 3 months ago

mhsmith commented 3 months ago

This is a lot more difficult than it sounds, because inserting the ghost preview may cause the existing elements on the page to move around in complex ways, which may in turn cause the calculated insertion point to change.

The result is that the page would rapidly switch back and forth between two layouts. In fact, it's already possible to make that happen with the current implementation, because when we add a red border to a component to indicate the drop zone, that causes its size to slightly increase.

mhsmith commented 3 months ago

114 changed the drop zone presentation to use an overlaid position: absolute element in most cases, so borders are now only used when dropping onto an empty container. However, dragging over component edges is still glitchy for some other reason (#119).