Skip to content
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

'Cannot read property 'call' of undefined' in matchesSelector function on clicking an element within Portal which is within draggable #300

Closed
dmrzn opened this issue Nov 17, 2017 · 4 comments

Comments

@dmrzn
Copy link

dmrzn commented Nov 17, 2017

Hello. We have the following UI structure:

<Draggable>
   <div>draggable header</div>
   <div>some regular content</div>
   <Portal>some content in portal</Portal>
</Draggable>

Where Portal is Portal component from https://github.com/tajo/react-portal

When mousedown event occurs in Portal - 'Cannot read property 'call' of undefined' error is thrown in matchesSelector function.

See https://codesandbox.io/s/v0nwywwlk7 for the details.

@svsool
Copy link

svsool commented Nov 27, 2017

I have the same problem. It should be easy to fix by adding if check here:

https://github.com/mzabriskie/react-draggable/blob/c39ef7b635a0a6f81a0ee35a892d026c61da389e/lib/utils/domFns.js#L22-L23

@svsool
Copy link

svsool commented Nov 27, 2017

I opened PR to fix this problem #303

@Antontelesh
Copy link

@svsool won't it break when trying to access document.parentNode then?
Also, I see that checks failed in your PR.

@Antontelesh
Copy link

Ah, I see that document has parentNode specified to null. ok then. good job! :)

@STRML STRML closed this as completed in 176f691 Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants