getkirby / kirby

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

[v4] Layout field: drag-drop a block into empty layout doesn't working #5910

Closed afbora closed 1 year ago

afbora commented 1 year ago

To reproduce

  1. Go to layout field
  2. Add a new layout and add into few blocks
  3. Add a new layout and try to drag-drop a block into new empty layout
  4. See error that you can't drop

Your setup

Kirby Version

Beta.3

distantnative commented 1 year ago

Do you think this is connected to https://github.com/getkirby/kirby/issues/5290 or unique issue?

bastianallgeier commented 1 year ago

I think it is connected to the flex thing that we had a while ago which we changed to improve the sizing on drag & drop. This means that the blocks are not full height when empty and thus you cannot drag something into an empty layout.

afbora commented 1 year ago

I think it's not connected since works as expected in 3.9.7 and beta.2.

distantnative commented 1 year ago

But if it worked in beta.2 ... I think @bastianallgeier the change you refer to was not just in beta.3 but earlier, or?

bastianallgeier commented 1 year ago

That's true. Need to dig deeper then :(

distantnative commented 1 year ago

Not too deep, stupid mistake when trying to clean up: The fault is this line https://github.com/getkirby/kirby/blob/v4/develop/panel/src/components/Forms/Blocks/Blocks.vue#L9 - when no blocks exist, k-draggable right now isn't in the DOM and cannot accept blocks dragged over it