Consider a virtual scroller containing items, every 10th one of which is an iframe. When that iframe falls out of the scroller's viewport, the iframe element will get removed from the DOM. Because of how iframes work, this will completely unload it. Similarly, if it scrolls back into view, the iframe will get reloaded from its src="" URL.
This isn't really acceptable behavior for a lot of use cases, e.g. ads or stateful widgets.
Some solution ideas:
Special case iframes?
Mark certain elements as "don't remove from the DOM", e.g. using an attribute virtual-scroller-dont-remove or similar?
Since the new approach (detailed in the newly-updated explainer) doesn't recycle/remove elements anymore, this should be a non-issue as the iframe would just stay where it was!
Consider a virtual scroller containing items, every 10th one of which is an iframe. When that iframe falls out of the scroller's viewport, the iframe element will get removed from the DOM. Because of how iframes work, this will completely unload it. Similarly, if it scrolls back into view, the iframe will get reloaded from its src="" URL.
This isn't really acceptable behavior for a lot of use cases, e.g. ads or stateful widgets.
Some solution ideas:
virtual-scroller-dont-remove
or similar?