-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamically created nested grid disappeared when dragging out (doesn't restore) #2948
Comments
yep, I see that... |
May I ask when you would like to fix this BUG ^ - ^ |
not high on my priority as I don't use nested grid at work, let alone dynamically nested grids. You can donate if you want it fixed sooner - reach out on slack. thanks. |
The function "removeAsSubGrid" adds a judgment to ensure that it is not eliminated removeAsSubGrid(nodeThatRemoved) {
if (!nodeThatRemoved._event) {
return
}
const pGrid = this.parentGridNode?.grid
if (!pGrid) return
pGrid.batchUpdate()
pGrid.removeWidget(this.parentGridNode.el, true, true)
this.engine.nodes.forEach((n) => {
// migrate any children over and offsetting by our location
n.x += this.parentGridNode.x
n.y += this.parentGridNode.y
pGrid.makeWidget(n.el, n)
})
pGrid.batchUpdate(false)
if (this.parentGridNode) delete this.parentGridNode.subGrid
delete this.parentGridNode
// create an artificial event for the original grid now that this one is gone (got a leave, but won't get enter)
if (nodeThatRemoved) {
window.setTimeout(() => Utils.simulateMouseEvent(nodeThatRemoved._event, "mouseenter", pGrid.el), 0)
}
} |
why are you closing this when it is not fixed in the lib ? are yu saying the first 2 lines fixes the issue now ? |
Yes. |
Are you still working after 6:00 at night? It is half past ten Beijing time. 😃 |
you can submit a code review and get credit with the fix. thanks. |
Watch the video https://gridstackjs.com/demo/nested_advanced.html
video_10086.mp4
The text was updated successfully, but these errors were encountered: