Page Include in popup blank on second load (conditionally)?

I think I figured out the problem. An error was throwing when opening the “sub-popup” / “sub-flyout” — “Uncaught Error: cannot call methods on tabs prior to initialization” – this I think was causing issues with trying to re-render items.

The cause of this error was custom display logic on components within the sub-popup, and setting fields that change the display logic just prior to opening the sub-popup. I think it’s because when you tell the sub-popup to open skuid then treats it as opened for display logic purposes, but if you do this in the same action sequence as setting a field value that affects display logic, the item is not actually rendered yet and throws an error when changing something that affects display logic on that item. That’s my guess at least. Removing the display logic item on the sub-popup prevented this error from throwing.

The error itself once it is thrown causes problems with the page afterwards, and likely also was messing up the re-render of the page include. It seems to cause an issue with taking actions on the page once but then once it tries and fails the second go works. Eg. Had a button that triggered display logic elements, those display logic elements would not update on first click of the button, but on second click they then would.

This is just a “workaround” by not doing the thing that causes the bug, but it’s definitely a bug in v1 squid involving rendering / display logic / setting items that have display logic that haven’t been rendered on the screen yet.