markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Mouseout not triggering in IE Edge #341

Open nosro opened 8 years ago

nosro commented 8 years ago

I see a mouseout bug which leaves the state highlight color active and doesn't close the hover popUp window.

This bug occurs when I view the demo at http://datamaps.github.io in IE edge app versions 25.10586.0.0 and 34.14300.1000.0 (rendering engine versions 13 and 14, respectively).

It may be related to this fix which was applied to fix a similar bug in previous versions of IE, but I think the fix doesn't detect IE Edge: https://github.com/markmarkoh/datamaps/issues/19

nosro commented 8 years ago

If I comment out this line, the bug goes away in IE Edge: https://github.com/markmarkoh/datamaps/blob/master/src/js/datamaps.js#L264

So it looks like the browser detection needs to be extended to cover Edge - or maybe this moveToFront call can be accomplished in a way that doesn't cause IE to have problems?

nosro commented 8 years ago

Maybe use broader IE detection like http://stackoverflow.com/questions/33152523/how-do-i-detect-ie-and-edge-browser

if (document.documentMode || /Edge/.test(navigator.userAgent)) { ... }

petersjoo commented 7 years ago

This worked for me: if ( ! /((MSIE)|(Trident)|(Edge))/.test(navigator.userAgent) ) { moveToFront.call(this); }

markmarkoh commented 7 years ago

@petersjoo any way you can send a pr for that?

ghost commented 6 years ago

Facing the same issue . I don't want to make any in the library (datamaps )file. Suggest me anything to change in my own .js file which uses this library.

siminino commented 6 years ago

I had to change this file in my local node_modules to generate a new bundle with no bugs. I know that this is ugly. There is already a PR for this issue, please merge that. 🙏

joke1 commented 5 years ago

@markmarkoh any way you can merge that pr?