marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
141 stars 40 forks source link

input event causes IE9 and 10 to throw an error. #109

Closed merwan7 closed 8 years ago

merwan7 commented 8 years ago

When using declarative event binding like this:

<input type="text" w-onInput="inputHandler" />

IE9 and IE10 throw an error: SCRIPT5007: Unable to get property 'target' of undefined or null reference. This is because marko-widgets is using attachEvent which, while it still works in those browsers, is deprecated and does not seem to support the input event correctly. The error is caused by window.event being undefined when handling input.

All other browsers (including IE11, in which attachEvent is no longer supported) work as expected.