title: why window.open() shows white screen only on iOS?
body: <p>I am building dApp and I would like to open my component in a new window by clicking a button.
  Here is part of my code.</p>
  <pre><code>const handleClickBalanceItem = (tokenType: TokenType) =&gt; {
    const tokenStatus = TokenStatus[tokenType];
    if (!tokenStatus.isIBCCOin) return;
    popoutQuickSwap(
      {
        swapType: SwapType.WITHDRAW,
        denom: tokenType,
        swapChains: {
          origin: tokenStatus.chain,
          foreign: ChainTypes.JUNO,
        },
      },
      true,
      (status: any) =&gt; {
        if (status) {
          toast.success(&quot;IBC Transfer Success!&quot;);
        }
      }
    );
  }; 
  
  ... ... ...
  
  const popoutQuickSwap = useCallback(
    (swapInfo: SwapInfo, isFullControl?: boolean, callback?: any) =&gt; {
      showNewWindow(
        &lt;QuickSwap
          swapInfo={swapInfo}
          isFullControl={isFullControl || false}
          closeNewWindow={(params: any) =&gt; closeNewWindow(params)}
        /&gt;,
        {
          title: &quot;Quick Swap&quot;,
          onClose: callback,
        }
      );
    },
    [closeNewWindow, showNewWindow]
  );
  
  ... ... ...
  
  const PopoutContextProvider = ({ children }: { children: any }) =&gt; {
    const [showWindow, setShowWindow] = useState&lt;boolean&gt;(false);
    const [windowOption, setWindowOption] = useState&lt;WindowOption&gt;();
    const [windowChildren, setWindowChildren] = useState&lt;WindowChildren&gt;();
  
    const closeNewWindow = useCallback((params?: any) =&gt; {
      setShowWindow(false);
      if (window.onClosePopoutFunc &amp;&amp; !window.promptedClosing) {
        window.onClosePopoutFunc(params);
      }
      window.promptedClosing = true;
    }, []);
  
    const showNewWindow = useCallback(
      (component: WindowChildren, options?: WindowOption) =&gt; {
        setWindowOption(options);
        setWindowChildren(component);
        setShowWindow(true);
        window.promptedClosing = false;
        window.onClosePopoutFunc = options?.onClose;
      },
      []
    );
  
    return (
      &lt;PopoutContext.Provider value={{ showNewWindow, closeNewWindow }}&gt;
        {children}
        {showWindow &amp;&amp; (
          &lt;RenderInWindow onClose={closeNewWindow} option={windowOption}&gt;
            {windowChildren}
          &lt;/RenderInWindow&gt;
        )}
      &lt;/PopoutContext.Provider&gt;
    );
  };
  
  ... ... ...
  
  const RenderInWindow = ({ option, onClose, children }: RenderInWindowProps) =&gt; {
    const [container] = useState&lt;any&gt;(document.createElement(&quot;div&quot;));
    const { isDark } = useContext(ThemeContext);
    const newWindow: any = useRef(window);
  
    useEffect(() =&gt; {
      // When container is ready
      if (container) {
        // Create window
        newWindow.current = window.open(
          &quot;&quot;,
          option?.title || &quot;&quot;,
          &quot;width=300,height=500,left=200,top=200,resizable=0&quot;
        );
        // Append container
        newWindow.current?.document?.body?.appendChild(container);
        if (isDark &amp;&amp; newWindow.current?.document?.body) {
          newWindow.current.document.body.style.backgroundColor = &quot;#313131&quot;;
        }
        newWindow.current.addEventListener(&quot;beforeunload&quot;, () =&gt; {
          if (!newWindow.current.alreadyPrompted) onClose();
          newWindow.current.alreadyPrompted = true;
        });
        copyStyles(window.document, newWindow.current.document);
  
        // Save reference to window for cleanup
        const curWindow: any = newWindow.current;
  
        // Return cleanup function
        return () =&gt; {
          curWindow.close();
        };
      }
    }, [container, option, onClose, isDark]);
  
    return container &amp;&amp; ReactDOM.createPortal(children, container);
  };
  </code></pre>
  <p>As you can see from my code I want to open <code>QuickSwap</code> component in a new window by clicking a button.
  On the other devices, it works properly, but only on iOS, when I click the button, the result is only a white screen.
  I have checked similar questions from <code>stackoverflow</code> but the answers don't work for me.</p>
  <p>Is there anybody who has some ideas about this issue?</p>