-
Notifications
You must be signed in to change notification settings - Fork 928
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
Rendering in iframe - clicks don't register #200
Comments
Hi @paul-veevers! Yeah, I'd be fine with your suggestion solution! Might even help push #185 along :) |
See #204 |
I have the impression that this bug still exists within ShadowDOM. Can someone confirm this? |
@Rendez, if you could provide a reproduction in codesandbox that would be great. If you're able to do that, then please file a new issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What you did:
Rendering downshift inside a different window/document to where the Javascript is running - e.g. inside an iframe.
What happened:
Clicks on items don't register.
Reproduction repository:
https://codesandbox.io/s/x2ynm9mojw
Problem description:
It's due to
window.addEventListener('mousedown'
andwindow.addEventListener('mouseup'
incomponentDidMount
. Referencing the "correct" window (the one the component is in) solves the problem.This may sound like a crazy use case, but it's quite common for 3rd party widgets, etc. I haven't tested but I assume the same is happening in a shadow dom.
Suggested solution:
Accept a prop called
context
or similar that defaults towindow
. I don't think it's possible to automatically get the parent window of a component?As a note, there's also a reference to
document
ingetItemNodeFromIndex
, which will also need to be changed.Happy to do a PR if that will help :)
The text was updated successfully, but these errors were encountered: