clauderic / clauderic/react-sortable-hoc
getScrollingParent's "el instanceof HTMLElement" logic will cause some problems
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 959
- PR merge metrics
- No merged PRs in 30d
Description
I have a scenario that causes el instanceof HTMLElement to always return false
If a new window is opened with window.open, mount the component to the child window button using ReactDOM.createPortal
react will use the document.createElement of the child window to create these DOM elements
This results in the DOM not being part of the main window, and when I get the DOM elements in my code and execute el instanceof HTMLElement, it always returns false, so I can't get the scroll elements
Here I provide the demo https://stackblitz.com/edit/react-pk98uy?file=src%2FApp.js,src%2Findex.js, which you can click in order: open win -> react create portal -> check element
console.log will print false
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.