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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/DraggableCore.es6
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,10 @@ export default class DraggableCore extends React.Component {
if (position == null) return;
const {x, y} = position;
const coreEvent = createCoreData(this, x, y);
const {ownerDocument} = ReactDOM.findDOMNode(this);

// Remove user-select hack
if (this.props.enableUserSelectHack) removeUserSelectStyles(ReactDOM.findDOMNode(this).ownerDocument.body);
if (this.props.enableUserSelectHack) removeUserSelectStyles(ownerDocument.body);

log('DraggableCore: handleDragStop: %j', coreEvent);

Expand All @@ -318,7 +319,6 @@ export default class DraggableCore extends React.Component {
this.props.onStop(e, coreEvent);

// Remove event handlers
const {ownerDocument} = ReactDOM.findDOMNode(this);
log('DraggableCore: Removing handlers');
removeEvent(ownerDocument, dragEventFor.move, this.handleDrag);
removeEvent(ownerDocument, dragEventFor.stop, this.handleDragStop);
Expand Down