I'm using FlexLayout which allows you to render a component in a popout window. I'm trying to get an AgGridReact component rendering in the popout. This works out of the box but the document/window context needs to be changed to that of the popout window. The FlexLayout docs mention:
any code in the popped out tab needs to use the document/window of the popout
Also mentions that you can do this in AG Grid using the getDocument() callback.
I'm aware you can get the new document using the ownerDocument property of the <div> wrapping the grid and pass a reference to this into the callback, however, this is not working. The grid is still using the Document that is on the global scope, i.e. the column menu dropdown can still only be closed by focusing on the original document, not by focusing on the popout document.
How can the document/window be changed successfully when the grid is popped out into a new window?