ticlo / rc-dock

Dock Layout for React Component
https://ticlo.github.io/rc-dock/examples
Apache License 2.0
684 stars 96 forks source link

Panel is duplicated after panel drag/drop on itself #226

Open vasko5petrov opened 11 months ago

vasko5petrov commented 11 months ago

Expected Behavior: Dropping a panel on itself should not modify the panel.

Actual Behavior: There seems to be a horizontal and vertical lines within the panel which are really small (1px). When intersected a drop indicator shows up and you can drop the panel on itself. This causes the panel to duplicate with the same ids and content.

Steps to reproduce: https://codesandbox.io/p/sandbox/rc-dock-tabs-issue-g5xjx2

  1. Start dragging panel with tab "a2" in it (drag the whole panel not the tab) image
  2. Go up, right before reaching the tabs line a drop indicator on the bottom of the panel will appear. image
  3. Going up or down 1px and the drop indicator disappears.
  4. Drop the panel on this exact 1px line when the drop indicator is visible.
  5. The whole panel will be duplicated with tab "a2" inside. image

This was tested on version "3.0.19" and "3.2.18" of rc-dock.