-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
targetWithinDownshift
always return false with different execution environment
#1255
Comments
Thanks for posting this. Will also take a look to understand what's going on. |
Ok, got it @KaiminHuang . I did not get the solution #1 to work, maybe it's Can you create a PR with the fix? We should also write a unit test for this, somehow. |
Can you check with |
Yes, my mistake. It should just be |
@silviuaavram Thanks for you help friend. I think there might be a mistake in |
I think I deleted it by accident. Can you create a PR with the fix and we can take it from there? |
Hi @silviuaavram, could I get your review on this PR? |
Fixed by #1264 |
@all-contributors please add @KaiminHuang for code, bug |
I've put up a pull request to add @KaiminHuang! 🎉 |
@silviuaavram @KaiminHuang the issue is still there in iOS browsers when using iframe, works fine on other platforms. |
Hi there,
I recently found an issue with
downshift
while the component is rendered in a different execution environment using React Portal.What you did:
Rendering a
downshift
component which is declared in an iframe module into the parent window DOM using Portal.Problem description:
The existing downshift code always check whether the target element is an instance of the original environment Node (in my case, iframeWindow.Node).
quote from MDN instanceof and multiple context (e.g. frames or windows)
What happened:
It resets downshift state on mouse up.
Relevant code or config
child instanceof Node
always return false because the target element is rendered in a different environment.Suggested solution:
🤔 I can think of two possible solutions here:
child instanceof Node
withchild instanceof environment.document.Node
child instanceof child.ownerDocument.defaultView.Node
The text was updated successfully, but these errors were encountered: