react-component / react-component/util
isVisible failing with element from a different window
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 670
- Forks
- 205
- Avg merge
- 11d 17h
- Merged PRs (30d)
- 4
Description
Hey,
I wanted to report a small issue with isVisible function.
I'm working on an application that opens new windows to show some components. We rely on react component for tooltips and popup and we realized that they are failing on those components that run on the new windows. After some investigation we realised that the issue came from the isVisible function that fails when the element comes from another window.
The problem comes from the element instanceof Element that always fails because the `Element' class instance is window dependant.
There is a fix for which is to rely on element.ownerDocument.defaultView.Element instead.
Would accept a PR for this issue?
Best,
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the isVisible function in the react-component/util codebase and inspect its Element instance check. Reproduce the behavior with an element from another window, then verify that the visibility check handles that element correctly using the owner document's window context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 39/100