getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

[v4] Dragged block "ghost" in wrong position when blocks field taller than viewport #5672

Open rasteiner opened 1 year ago

rasteiner commented 1 year ago

Description

When I drag a block from a blocks field which is taller than the viewport (and I scrolled to the bottom of the panel page), the dragged block is removed from the document flow, this causes the document to become shorter, this causes the browser to scroll up (to the new bottom), and this causes the "ghost image" of the dragged block to be in the wrong position in respect to the mouse cursor.

Expected behavior
The ghost image of the block should stay where the mouse cursor is.

Screenshots

https://github.com/getkirby/kirby/assets/6684137/52420a45-9e74-4103-937b-4e931346e364

To reproduce

  1. Have a blocks field
  2. Go to it in the panel
  3. Create enough blocks to make the blocks field taller than the browser viewport
  4. Scroll down way to the bottom
  5. Start dragging a block

Your setup

Kirby Version
4.0.0-beta.1

Your system (please complete the following information)

distantnative commented 1 year ago

We probably won't be able to fix this as this looks like an issue of the underlying https://github.com/SortableJS/Vue.Draggable library

distantnative commented 3 months ago

@rasteiner could you please try if this by any chance its solved with v5-alpha.1?

rasteiner commented 3 months ago

@rasteiner could you please try if this by any chance its solved with v5-alpha.1?

I don't think so:

https://github.com/user-attachments/assets/c091f364-b519-4bea-9475-31d9030e2b86

PS: yay! Darkmode!