Scoped Document (handle pop out window with `ReactDOM.createPortal`)
Feature
Overview of the problem
I'm using react-rnd 10.0.0
My browser is: Chrome
I am sure this issue is not a duplicate? Yes
Reproduced project
https://codesandbox.io/embed/nostalgic-chaum-se04o
Description
This is a bit of an edge case, but I'm using react-rnd inside a react portal which has been opened in a new window.
The issue I have is that react-rnd uses boundary = document.querySelector(this.props.bounds); which hsa the scope of the original window. https://github.com/bokuweb/react-rnd/blob/eb3313eccf664e7274edd1bd17c90ea163c74729/src/index.tsx#L379
This means that it can not find the selector or window for resizing or moving of the Rnd.
I'd like to propose a change to include a prop scopedDocument where you could pass in the document you wish the library to use.
Is this something you'd be interested in merging in if I created a PR?
I know this is 5 years old, but still the only issue I found related to this topic.
See https://github.com/bokuweb/react-rnd/pull/920#issuecomment-2468904319.