Skip to content

fix(2.x): fix forum widget layout and admin editor drag-and-drop#2

Merged
imorland merged 1 commit into2.xfrom
im/2x-layout-fixes
Apr 12, 2026
Merged

fix(2.x): fix forum widget layout and admin editor drag-and-drop#2
imorland merged 1 commit into2.xfrom
im/2x-layout-fixes

Conversation

@imorland
Copy link
Copy Markdown
Member

Summary

  • Replace broken vnode-mutation approach with proper PageStructure extension points: top/bottom sections via mainItems() (wrapped in .container for correct width), end section via containerItems() as a flex sibling of the content column
  • Guard all widget sections against rendering when empty (previously relied on CSS :empty which left orphan container divs)
  • Fix admin editor DOMException: Node.removeChild crash when dragging widgets — add onbeforeupdate={() => false} to prevent Mithril re-rendering the Sortable.js-owned DOM, and remove the cleanupLayout workaround that existed to undo those re-renders
  • Fix stable key on layout widget list items (was random, causing Mithril key mismatches)
  • Update README import paths to use ext: prefix per Flarum 2.0 module import convention

@imorland imorland merged commit 0a47db8 into 2.x Apr 12, 2026
10 checks passed
@imorland imorland deleted the im/2x-layout-fixes branch April 12, 2026 23:20
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.

1 participant