react-sortable icon indicating copy to clipboard operation
react-sortable copied to clipboard

Firefox navigates to the url with the text of the dragged item

Open denn1s opened this issue 7 years ago • 1 comments

I'm trying the demo, http://webcloud.se/react-sortable/, in Firefox and there is an issue in that after sorting the list the web browser navigates to another page. For example, dragging "Hotpink" around makes the browser navigate to http://www.hotpink.com/ (which is a porn site, by the way).

This is the user agent where I tested this: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0

This is the expected behaviour in Firefox (also in IE, so the issue is probably also present there) so in order to fix it you might need to implement the onDrag event and stop its propagation:

SortableComposition.js

    ...
    handleDrop = (e) => {
       e.preventDefault();
    }

    render() {
      let newProps = Object.assign({}, this.props)
      delete newProps.onSortItems
      const { sortId, ...props } = newProps
      return (
        <Component
          ...
          onDrop={this.handleDrop}
          ...
        />
      )

denn1s avatar Apr 24 '18 18:04 denn1s

Same issue here

ghost avatar May 05 '19 21:05 ghost