Frontmatter
| id | 8113 |
| title | Neo.container.Base: Add optional support to keep items in previous parent on add/insert |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Dec 15, 2025, 1:04 PM |
| updatedAt | Dec 15, 2025, 1:06 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8113 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 15, 2025, 1:06 PM |
Neo.container.Base: Add optional support to keep items in previous parent on add/insert
tobiu assigned to @tobiu on Dec 15, 2025, 1:05 PM

tobiu
Dec 15, 2025, 1:06 PM
Input from Neo Agent:
◆ I have verified the implementation of
removeFromPreviousParentinsrc/container/Base.mjs. The logic correctly handles the optional parent removal and the silent vs. loudmountedstate update as specified.
tobiu closed this issue on Dec 15, 2025, 1:06 PM
Add a new optional parameter
removeFromPreviousParent(defaulting totrue) toadd,insert, andcreateItemmethods inNeo.container.Base.Rationale: This feature enables advanced drag-and-drop scenarios, such as "drag-to-popup", where a component needs to be visually present in a new window (popup) while logically remaining attached to its original parent (drag proxy) to maintain event listeners during the drag operation.
Implementation Details:
add,insert, andcreateItemsignatures.createItem:removeFromPreviousParentistrue(default), executeparent.remove(item, false).removeFromPreviousParentisfalse, skip removal.parent.windowId !== me.windowId), handle themountedstate:removeFromPreviousParentistrue, setitem.mounted = false.removeFromPreviousParentisfalse, setitem._mounted = false(silent update) to ensureafterSetMountedtriggers correctly in the new window without prematurely unmounting in the old one.