infinite-viewer
infinite-viewer copied to clipboard
new InfiniteViewer will empty the iframe
There is an iframe in the viewport, and the content of the iframe will be cleared after the new InfiniteViewer
Here is my minimal rendition https://stackblitz.com/edit/stackblitz-starters-rb32s7?file=src%2FApp.tsx
emty dom
@daybrush Trying to downgrade the version can't solve it, it seems to be a persistent problem
It is normal to write before iframe write, and init will reproduce after write
After looking at the source code, these two lines of code lead to
if (!wrapperElement) {
wrapperElement = doc.createElement("div");
wrapperElement.insertBefore(this._viewportElement, null);
containerElement.insertBefore(wrapperElement, null);
}
@zlyyyy
If there is an iframe inside the viewport, refresh may occur during the process of appendChild and insertBefore. As in your comment, it's probably best to set the wrapperElement as an ad-hoc.
The framework also creates a wrapper and sets it through props.
@daybrush Yes, I temporarily solved it by setting wrapperElement