Skip to content

Page Components: fix drag-and-drop placement into and out of layout regions #10672#10673

Merged
edloidas merged 1 commit into
masterfrom
issue-10672
May 31, 2026
Merged

Page Components: fix drag-and-drop placement into and out of layout regions #10672#10673
edloidas merged 1 commit into
masterfrom
issue-10672

Conversation

@edloidas
Copy link
Copy Markdown
Member

Fixes drag-and-drop placement in the Page Components tree: dropping into a region now lands at the pointed position (not the end), an empty layout region can be entered from either direction, and dragging an item out to the parent level is reliable. The dragged row re-indents to show the level it will land at.

  • Wires PageComponentsView to the SortableList projection API: maps the flattened tree to drop nodes, resolves the target with projectTreeDrop, and commits via requestComponentMove.
  • Removes the lossy resolveTargetPath heuristic and the isDropAllowed prop; reuses hasLayoutAncestor to block layout-in-layout drops.
  • Exports calcSpacerWidth from PageComponentsItem and applies context.projectedIndent so the dragged row re-indents to its projected level.
  • Affects both the docked Page Components tab and the floating detached panel; DetachedPageComponentsView is unchanged.

Requires enonic/lib-admin-ui#4513.

Closes #10672

Drafted with AI assistance

…egions #10672

Wired PageComponentsView to the SortableList projection API via projectTreeDrop.
Mapped flattened tree nodes to drop nodes and committed moves with requestComponentMove.
Replaced resolveTargetPath and the isDropAllowed prop; reused hasLayoutAncestor to block layout-in-layout.
Exported calcSpacerWidth so the dragged row re-indents to its projected level.
@edloidas edloidas self-assigned this May 31, 2026
@edloidas edloidas merged commit d7bba08 into master May 31, 2026
12 of 13 checks passed
@edloidas edloidas deleted the issue-10672 branch May 31, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page Components: fix drag-and-drop placement into and out of layout regions

1 participant