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

Not working with ie 11 #1

Open
claudiorivetti opened this issue Jan 8, 2014 · 7 comments
Open

Not working with ie 11 #1

claudiorivetti opened this issue Jan 8, 2014 · 7 comments
Labels

Comments

@claudiorivetti
Copy link

line 264:
e.dataTransfer.setData('text/plain', '')

gives an error.

@bensmithett
Copy link
Owner

Thanks for letting me know :) from a quick look it might be fixed by changing text/plain to text http://msdn.microsoft.com/en-us/library/ie/ms536744(v=vs.85).aspx

I'll have a look tomorrow when I have a Windows VM handy.

@claudiorivetti
Copy link
Author

That is a problem in your demo page, however dragster.js is not working in IE because of the luck of:
CustomEvent

would it be possible to replace CustomEvent with:

var evt = document.createEvent("CustomEvent");
evt.initCustomEvent('dragster:leave', true, true, {
'cmd': "blerg!"
});

as suggested here:
http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563

@bensmithett bensmithett added the bug label Mar 3, 2014
@KrisTemmerman
Copy link

Any updates on this issue

@bensmithett
Copy link
Owner

Sorry everyone, I haven't looked at this repo for ages. #9 fixes this apparently - I don't have IE available for the next few days, can anyone confirm @christophermina's rewrite fixes this issue for you?

@MickL
Copy link

MickL commented Jun 7, 2016

I can confirm the pull request is working!
I tried within Windows 10 with Internet Explorer 9, 10, 11 and Edge. Looks fine even in IE9!

@MickL
Copy link

MickL commented Jun 7, 2016

Interestingly, added CSS-classes don't change the DOM in IE and Edge while "dragster:enter" event. Even jQuery $('#object').css('display', 'block'); doesn't change anything.

Also interestingly the new styles are getting visible on next change, for example if you have :hover styles but i was not able to trigger rerendering while drag.

To reproduce:

  1. Try changing some DOM while "dragster:enter", e.g. adding a class
  2. Drag something in
  3. The classes are added, but the DOM doesn't change visibly

Now if the targeted DOM-element has some :hover CSS-style and you didn't remove the added class on dragster:leave you can hover the element. NOW the styles are shown.

@MickL
Copy link

MickL commented Jun 8, 2016

I found a solution for this css-rerendering bug on IE. Im using jQuery, but this may work also for plain JavaScript. My code looks like this:

 dropzone.addEventListener("dragster:enter", function(e) {
                $index.addClass("dragEnter");
                $index.hide().show(0); // IE-fix
}

 dropzone.addEventListener("dragster:leave", function(e) {
                $index.removeClass("dragEnter");
                $index.hide().show(0); // IE-fix
}

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

No branches or pull requests

4 participants