internet explorer - event.preventDefault() is not working in IE 11 for custom events -
I have a polymer element that triggers a custom event with synchronous and I want to know the event event.preventDefault Was canceled). Modified by using Event.default I can take action to act on all browsers (Chrome, Canary, Firefox, Opera) but on IE 11 (not worried about older browsers) it is not working I know that I can set some property on my event and I can check back where I want to trigger and handle, but I want to know that I am missing something.
You can try the code by
I had the same problem and the following Can solve with hack:
Var event = document.createEvent ('CustomEvent'); Event.initCustomEvent ('custom', true, true, {}); Event.preventDefault = function () {Object.defineProperty (This, "appears to be default", {get: function () {returns true;}}); }; Event.preventDefault (); Event.defaultPrevented; // true
Comments
Post a Comment