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

onclick issue in IE10 #65

Closed
StanislausLem opened this issue Sep 27, 2016 · 4 comments
Closed

onclick issue in IE10 #65

StanislausLem opened this issue Sep 27, 2016 · 4 comments
Labels

Comments

@StanislausLem
Copy link

Hi
It seems that latest build of jquery.gray.js is blocking "onclick" in IE11.

<link rel="stylesheet" href="css/gray.min.css"> 
<img id="badge1" src="badge1.png" class="grayscale" onclick="console.log('ping')">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> 
<script src="js/jquery.gray.min.js"></script> 

No problem on Chrome or FF

@karlhorky
Copy link
Owner

karlhorky commented Sep 27, 2016

Can you please provide a demo where this fails in IE 11? This is because the target element is replaced with an <svg> element, and the event listeners are not re-registered on the new elements.

I've documented this in 99f6736

@StanislausLem
Copy link
Author

Four lines of minimal demo already provided on my first post. ;p
Onclick won't be fired at all.

@karlhorky
Copy link
Owner

I mean a live demo which can be tested and debugged.

I've added one here for you:
https://jsfiddle.net/karlhorky/08ugd4vz/

@karlhorky
Copy link
Owner

Currently I'm going to mark this as wontfix because we would need to register all other event listeners as well.

I guess the correct way to do this would be for the plugin to fire events when the element is replaced so that user JavaScript could re-register event listeners. I don't have time to do this feature right now myself, but I would accept a pull request for this.

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

2 participants