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

Get ownerDocument before calling onStop handlers #198

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

acusti
Copy link
Contributor

@acusti acusti commented Sep 7, 2016

If a draggable onStop handler (invoked in DraggableCore:318) causes the wrapped component to unmount, calling ReactDOM.findDOMNode in line 321 will error with Uncaught Invariant Violation: findDOMNode was called on an unmounted component.

Using findDOMNode before calling onStop avoids that bug and prevents having to also invoke it for the userSelect hack. A win-win.

If a draggable onStop handler causes the wrapped component to unmount,
ReactDOM.findDOMNode will error with “Uncaught Invariant Violation:
findDOMNode was called on an unmounted component”. This avoids that.
Plus it’s cleaner.
@STRML
Copy link
Collaborator

STRML commented Sep 7, 2016

👍 Nice fix.

@STRML STRML merged commit 496f82e into react-grid-layout:master Sep 7, 2016
@bkniffler
Copy link

Could you please publish this to npm? Thanks!

@acusti
Copy link
Contributor Author

acusti commented Sep 14, 2016

@bkniffler If you want an installable version with this fix, you can temporarily use:
"react-draggable": "Brandcast/react-draggable#1de1e66",

in your package.json until this gets published. The #1de1e66 hash just points to my commit of the built files.

@STRML
Copy link
Collaborator

STRML commented Sep 14, 2016

This is published as v2.2.2.

Andrew Patton mailto:[email protected]
September 14, 2016 at 11:31 AM

@bkniffler https://github.com/bkniffler If you just want an
installable version with this fix, you can temporarily use:
|"react-draggable": "Brandcast/react-draggable#1de1e66",|

in your package.json until this gets published.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#198 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABJFP10oJE8alFxnXW5eG_r5XcdEEg-8ks5qqCFTgaJpZM4J2g9Q.

Andrew Patton mailto:[email protected]
September 6, 2016 at 11:06 PM

If a draggable |onStop| handler (invoked in DraggableCore:318
https://github.com/mzabriskie/react-draggable/blob/master/lib/DraggableCore.es6#L318)
causes the wrapped component to unmount, calling
|ReactDOM.findDOMNode| in line 321
https://github.com/mzabriskie/react-draggable/blob/master/lib/DraggableCore.es6#L321
will error with |Uncaught Invariant Violation: findDOMNode was called
on an unmounted component|.

Using findDOMNode before calling |onStop| avoids that bug and prevents
having to also invoke it for the userSelect hack. A win-win.


    You can view, comment on, or merge this pull request online at:

#198

    Commit Summary


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#198, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABJFP7DwQQsbZGGgXiBdxDkWr8FVOvA0ks5qnjhPgaJpZM4J2g9Q.

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

Successfully merging this pull request may close these issues.

3 participants