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

Use window/document relative to DOM element #180

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Use window/document relative to DOM element #180

merged 1 commit into from
Jul 19, 2016

Conversation

STRML
Copy link
Collaborator

@STRML STRML commented Jul 19, 2016

Use the ownerDocument and window of the DOM element being manipulated
rather than the global window and document objects. This makes
react-draggable work with a tool like
https://github.com/ryanseddon/react-frame-component

This replaces #177 which still needs some tests.

Use the ownerDocument and window of the DOM element being manipulated
rather than the global window and document objects. This makes
react-draggable work with a tool like
https://github.com/ryanseddon/react-frame-component
@STRML STRML merged commit 0cddb23 into master Jul 19, 2016
@@ -17,15 +17,17 @@ export function getBoundPosition(draggable: Draggable, x: number, y: number): [n
const node = ReactDOM.findDOMNode(draggable);

if (typeof bounds === 'string') {
const {currentDocument} = node;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentDocument is a thing? Didn’t know about that one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it's actually not. Gap in our test coverage to be sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acusti
Copy link
Contributor

acusti commented Jul 19, 2016

Beautiful! This is exciting.

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.

None yet

2 participants