You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to integrate react-pannellum in a 3rd party application, and while this works in general, I found a niche problem.
This 3rd party application provides a function to detach ('pop-out') certain elements from its UI, and open those in a separate browser window. This is very convenient, because a user can now have Pannellum in a window side-to-side with the rest of the application.
The problem is that some of your code relies on the current document, and the current window. In my case, these are the document and window from which the pop-out was initiated, and not the new window. This results in pannellum trying to render to the wrong document.
I think I managed to hack this on my end, so if you take PR's?
Otherwise, these are the necessary changes:
In the render() method add a ref value to the returned div, e.g. ref: "myself",
In _this.init(): Reference that ref, rather than container: myPannellum = pannellum.viewer(_this.refs.myself, {
In onImageLoad() where the event listeners are set up, replace document with container.ownerDocument, and windows with container.ownerDocument.defaultView
Maybe more work is needed, but at least this seems to have fixed it for me.
The text was updated successfully, but these errors were encountered:
I am trying to integrate react-pannellum in a 3rd party application, and while this works in general, I found a niche problem.
This 3rd party application provides a function to detach ('pop-out') certain elements from its UI, and open those in a separate browser window. This is very convenient, because a user can now have Pannellum in a window side-to-side with the rest of the application.
The problem is that some of your code relies on the current document, and the current window. In my case, these are the document and window from which the pop-out was initiated, and not the new window. This results in pannellum trying to render to the wrong document.
I think I managed to hack this on my end, so if you take PR's?
Otherwise, these are the necessary changes:
render()
method add a ref value to the returned div, e.g.ref: "myself",
_this.init()
: Reference that ref, rather than container:myPannellum = pannellum.viewer(_this.refs.myself, {
onImageLoad()
where the event listeners are set up, replace document with container.ownerDocument, and windows with container.ownerDocument.defaultViewMaybe more work is needed, but at least this seems to have fixed it for me.
The text was updated successfully, but these errors were encountered: