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

Sortable not working in firefox #56

Closed
stefanomiccoli opened this issue Oct 20, 2016 · 2 comments
Closed

Sortable not working in firefox #56

stefanomiccoli opened this issue Oct 20, 2016 · 2 comments

Comments

@stefanomiccoli
Copy link

Hi everybody.

We are using react-sortable in the admin UI of a project.
The client reports that tool is unusable in firefox (>=49.0.0 both win and linux). After sortEnd it always redirect the browser to about:blank.
I'm still looking at the code to determine the cause, but it is visible also on official demos here http://webcloud.se/react-sortable/

How to reproduce:

  1. Go to http://webcloud.se/react-sortable/ with FF
  2. reorder an item in the list
  3. you are being redirected to about:blank

Strange thing is that if you try to drag an item outside the list (either as first or last element), sorting works well.

As soon as I find the problem (and if im able to fix it) I will fork and submit a merge request.

Cheers,
Stefano

ladas-larry added a commit that referenced this issue Oct 20, 2016
@ladas-larry
Copy link
Collaborator

I can see, this is possible to fix by setting an onDrop callback that will call preventDefault() function.

Like this:

 <Component
          ....
          onDragOver={this.dragOver}
          onDragStart={this.sortStart}
          onDragEnd={this.sortEnd}
          onDrop={function(e){e.preventDefault();}}
           ....
          />

I have already pushed a fix to master branch, I will release it at some point today.

@stefanomiccoli
Copy link
Author

Nice, I was looking at the wrong point (onDragEnd) and it didnt work.

Thank you!

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

2 participants