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

onDrop is never called #5

Closed
danielhusar opened this issue Dec 14, 2015 · 7 comments
Closed

onDrop is never called #5

danielhusar opened this issue Dec 14, 2015 · 7 comments

Comments

@danielhusar
Copy link

This is how my code looks like:

  _handleFileDrop(files, event) {
    console.log(files, event);
  }

  render() {
    return (
      <div className="content">
        <FileDrop frame={document} onDrop={this._handleFileDrop}>Drop some files here!</FileDrop>
      </div>
    );
  }

css: (css from your example is not working as well)

.file-drop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.file-drop > .file-drop-target {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  transition: all 150ms linear;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-content: center;
  text-align: center;
}

.file-drop > .file-drop-target.file-drop-dragging-over-frame {
  border: 5px dashed #ccc;
  background-color: rgba(255, 255, 255, .2);
  box-shadow: none;
  z-index: 50;
  opacity: 1;
}

onDrop callback is never called even that I see the proper styling (but file-drop-dragging-over-frameclass is not added) when hovering the file over document.
I suspect its probably because it things that files was not dropped over file-drop-target however Im not sure why as it fills the 100% of its parent.

React 0.14.3

@dignifiedquire
Copy link

Seeing the same issue

@sarink
Copy link
Owner

sarink commented Dec 29, 2015

@danielhusar @dignifiedquire
What browser/version are you guys testing with? What version of React are you using? In what ways is your code different from the working demo? http://sarink.github.io/react-file-drop/demo/

Sorry I haven't had time to look into this yet! I'm sure it's something simple.

@dignifiedquire
Copy link

@sarink It's in https://github.com/ipfs/station React is at 0.14 and it's using the latest electron

@danielhusar
Copy link
Author

latest chrome and react 0.14

@danielhusar
Copy link
Author

I have it pretty much the same, only maybe except es6

@JonathanWi
Copy link

Same issue here. Did you guys solved this?

@coniel
Copy link
Contributor

coniel commented Jan 23, 2016

Fixed it #6

@sarink sarink closed this as completed Feb 3, 2016
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

5 participants