react-component / react-component/util

Function isDom not working inside iframe

Open
#460 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
670
Forks
205
Avg merge
11d 17h
Merged PRs (30d)
4

Description

When I use isDom(node) inside an iframe, it always returns false.
As a simple example (output in the console log): https://codesandbox.io/s/goofy-night-y5w6w9?file=/src/App.js

Version: rc-util: 5.29.3

Lib @rc-component/trigger Use this function and get wrong output with Tooltip, Popover, etc. in an iframe: https://github.com/react-component/trigger/blob/master/src/index.tsx#L235

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the iframe case from the linked CodeSandbox, then inspect the isDom entry point and its use in @rc-component/trigger's src/index.tsx. Compare behavior for nodes from the main document and iframe; done means isDom correctly recognizes the iframe node and the reported Tooltip and Popover behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.