fix: DH-21257: Check if panel parent is in root when opening#1366
Conversation
|
ui docs preview (Available for 14 days) |
| const rootChild = | ||
| root.contentItems.length > 0 ? root.contentItems[0] : root; | ||
| rootChild.addChild(parent); | ||
| } |
There was a problem hiding this comment.
Hmm.. a couple odd things when doing it like this:
- The row layout is still lost (all the panels are stacked in one column instead of across like in a row)
- The stack header for the last item does not seem to appear
The row layout not being respected is kind of "well we're trying our best", but the stack header not appearing seems to be a bug (you can't drag to move that item anymore... though it does re-appear if you drag another panel...).
Right now we're just adding the parent if it's not attached; but I'm wondering if we should be re-adding the top most parent that isn't attached. A bit of a complication is that we would need to ensure it doesn't contain containers that have already been moved to somewhere else before re-attaching ... but I think would ultimately be more correct, and fix that header case. See if that's possible.
There was a problem hiding this comment.
Updated to add top most parent. This also fixed the header issue.
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
mofojed
left a comment
There was a problem hiding this comment.
I like this behaviour better, seems to be the best we can do. Note that it's still a bit weird if you go down to 1 panel, then to 5 (new row added), then down to 2 panels, then to 5 again (new row added), but that's the way it is.
Looks like you might need to fix some tests.
|
ui docs preview (Available for 14 days) |
When opening a panel, check if the parent has been removed from root. If it has, add it back to the layout root so that the panel will appear somewhere in the layout.