angular-ui / ui-mask

Mask on an input field so the user can only type pre-determined pattern
https://htmlpreview.github.io/?https://github.com/angular-ui/ui-mask/master/demo/index.html
MIT License
391 stars 257 forks source link

Tests fail in IE 9-11 #5

Closed NickTomlin closed 8 years ago

NickTomlin commented 9 years ago

Running the tests with sauce (or against local VMs) results in the following failing specs:

screen shot 2015-07-02 at 5 24 33 pm

I'd be happy to help troubleshoot this if you have any ideas on where to start with the mask code. Also, getting these tests running on CI would be great (happy to help set that up as well, if you have an open source Sauce account).

PowerKiKi commented 9 years ago

Thanks for reporting. I am unfortunately not familiar with ui-mask codebase, nor sauce. But ui-mask quality and reliability could clearly be improved. There were a lots of reported bugs in previous repository for ui-mask.

So if someone would step up and take a few initiative on that project, that would probably be very welcome by its users. But I'm afraid this won't be me. I will merge PR, but can't do much more than that.

NickTomlin commented 9 years ago

Thanks for the response! I am using an older version of ui-mask and would love to see it more actively maintained. I'll see if I can find some time to help make improvements. Is there an IRC channel/community for the ui-* components? Thanks again for you willingness to review and respond to issues/prs.

PowerKiKi commented 9 years ago

Not sure about IRC, but we could try to actually use https://gitter.im/angular-ui. I know ui-grid is quite active on Gitter. I guess that would be nice if the organisation itself got some activity too...

PowerKiKi commented 9 years ago

Mhh... I just noticed that organisation rooms are private only on Gitter. So maybe we could create a room only for ui-mask ? I'll check with others what they think of that ...

PowerKiKi commented 9 years ago

We now have https://gitter.im/angular-ui/ui-mask available if you want to chat about ui-mask...

lukepfeiffer10 commented 8 years ago

It appears that the input.triggerHandler("input") in some if not all of the tests on IE does not actually trigger the eventHandler function. I haven't been able to find anything conclusive about why this might be happening from a Google search.

I believe changing input.triggerHandler("input") to input.triggerHandler("change") will make the tests pass on IE but I'm not sure if that is necessarily something we want to do as this might be a bigger issue that needs to be fixed.

EDIT:

Discovered the actual issue here is that in some tests the ui-mask directive on the input element isn't properly initialized before trying to trigger the handler which obviously means there is no handler bound yet. This happens occasionally because we don't have a $digest cycle before triggering the handler and the initialization code is not run until a $digest cycle. More specifically a $digest cycle that notices the ui-mask attribute has been modified.

Oddly enough, this isn't a problem in other browsers and I haven't figured out yet what that reason is because there might be an interesting bug hidden in those results.

In order to get the tests running properly, I am splitting some tests into multiple as they did too much to begin with and then running a scope.$apply to get the initialization code to work. Hopefully with these changes we can add IE to the browser testing in travis too and have more robust testing.