Skip to content
This repository has been archived by the owner on Jun 18, 2018. It is now read-only.

[In progress] Fix iframe #27

Closed

Conversation

Vadorequest
Copy link

Allow to pass a specific target to setup/teardown functions. "window" is still the default target.

@@ -34,25 +34,26 @@ export default class HTML5Backend {
this.endDragNativeItem = this.endDragNativeItem.bind(this);
}

setup() {
if (typeof window === 'undefined') {
setup(target = window) {
Copy link

Choose a reason for hiding this comment

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

@Vadorequest I see this is closed, but I'm doing somewhere where this would be really useful. I'm just wondering how you would wire things up to pass in an alternative target?

Copy link
Member

Choose a reason for hiding this comment

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

I have some PRs open that include the ability to use a different window context. After we get done with basic maintenance things I will add this

Copy link
Member

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

@darthtrevino Oh, nice! Thanks for that. If I wanted to play around with that, how does one pass along a different context?

e.g. From:

export default DragDropContext(HTML5Backend)(IframeDragReceiver)

to ... ?

Copy link
Member

Choose a reason for hiding this comment

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

When it finalizes, it will look something like:

render() {
  <DragDropContext backend={HTML5Backend} context={{window: iframeWindowInstance}}>
   // your app
  </DragDrapContext>
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants