Changed
sw-cms-stage-add-sectionnow extends the innersw_cms_add_section_buttonblock instead of the outersw_cms_add_section, so the saved-section picker sits inside.sw-cms-stage-add-sectionrather than turning the component root into a fragment (fragment children take their anchors from the stage's children list, which reintroduced the same patch mismatch).Removed the
$nextTick/ close-before-mutate workarounds insw-cms-block-config.dmfOnSaveVisibility()anddmf-section-settings-modal.onClose(). They worked around the symptom above and their comments blamed a Vue<teleport>that was never involved — visibility now mutatescustomFields, persists, then closes in the normal order.All eight modal components accept a
hostSelectorprop (default'body'), forwarded tosw-modal'sselector. New shared stylesheetsrc/app/dmf-cms-modal-host.scsshides an idle host (.dmf-cms-modal-host:empty) so it contributes no layout.
Fixed
Configuring block/section visibility twice threw
insertBeforeerrors and the modal stopped opening. Setting up visibility worked once; changing it afterwards loggedNotFoundError: Failed to execute 'insertBefore' on 'Node'followed byTypeError: Cannot read properties of null (reading 'insertBefore'), and from then on the modal never reappeared. Cause: coresw-modalrelocates its own root node inmountedComponent()(document.querySelector(this.selector).appendChild(this.$el),selectordefaults tobody) and defers$el.remove()by 400 ms. Vue'spatchBlockChildrenderives the patch container for a component child fromhostParentNode(oldVnode.el)— after the relocation that isbody— while the sibling anchors still belong to the plugin's own subtree. On open, Vue wrote itsv-ifplaceholders intobodyanchored tobodytext nodes; on close,sw-modal's deferred removal orphaned that anchor,insertBeforethrew, the host lost its placeholder, and every later open mounted into anullcontainer. Everyv-if'd modal in the plugin now renders into its own hostdivwhose per-instance id (${this.$.uid}) is passed tosw-modalasselector, so the node is re-appended where Vue already put it and container and DOM parent stay in sync. Applied to all 12 mount sites: block settings sidebar (save / linked editor / visibility), Section settings modal (nested save + linked editor), section actions, stage add section picker, category layout form, and both library list pages (preview / edit / usage). The modal keeps rendering as a full-viewport overlay —.sw-modalstaysposition: fixed, no ancestor in these subtrees creates a containing block.