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

Droppable not working in IE 11 #30

Open
ShivamChaurasia opened this issue Jul 28, 2017 · 4 comments
Open

Droppable not working in IE 11 #30

ShivamChaurasia opened this issue Jul 28, 2017 · 4 comments

Comments

@ShivamChaurasia
Copy link

Getting "Unexpected call to method or property access." error while drag start.

@jmas
Copy link

jmas commented Mar 15, 2018

@ShivamChaurasia Bump, do you have thoughts what the issue about? I will look on it, but if you found solution - please write here. Thanks.

@LakshmiTatineni
Copy link

Object.assign() in Draggable.js and Droppable.js does not work in IE and that is causing the issue

@kominayu
Copy link

@ShivamChaurasia were you using a type other than "text" by any chance?

@AldoS
Copy link

AldoS commented Jul 24, 2019

@ShivamChaurasia I have the same issue on IE11, the problem is here:

onDragStart: {
            value: function onDragStart(e) {
                if (typeof this.props.onDragStart === "function") this.props.onDragStart(e);
                var props = Object.assign({}, this.props);
                if (this.props.wrapperComponent) props = Object.assign(props, this.props.wrapperComponent.props);
                e.dataTransfer.setData(props.type, props.data);
            }
        },

and more specific here
e.dataTransfer.setData(props.type, props.data);
IE accepts only text as type in dataTransfer.setData as @kominayu mentioned above.

Solution:

  1. Change your draggable type to text

  2. Remove prop types from Dropable because text doesn't seem to be an acceptance type.

  3. Then create a onDrop prop function on Dropable to get the data - e.dataTransfer.getData("text");

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