candreoliveira / ngMask

Best Angular mask alternative! No jQuery, pure JS. About ~6kb!
http://candreoliveira.github.io/#/ngMask
ISC License
419 stars 171 forks source link

Safari issue with following mask. #53

Open martea opened 9 years ago

martea commented 9 years ago

Currently using this mask to identify/mask SSN number and some how it fails on the fullRegex.test(viewValueWithDivisors) and controller$isEmpty(controller.$nodeValue) in the parser,

9?9?991939-9999

when i tried to enter 88888 and then enter a last 8 so the new number is 888888, the validation gives an error and i cannot change any chars in the input

i only encounter this issue on safari browser, is this any known issue?

martea commented 9 years ago

if i remove this segment it works.

   var wrongPosition = maskService.getFirstWrongPosition(viewValueWithDivisors);
                                          if (angular.isDefined(wrongPosition)) {
                                              debugger;
                                              setSelectionRange(wrongPosition);
                                          }
martea commented 9 years ago

what is this segment suppose to do, set the marker were the input is false?

aaronroberson commented 8 years ago

@martea If you add clean="true" does it resolve your problem?

yuanyma commented 7 years ago

+1, having same issue as @martea on Safari. It seems like the input is either blurred or the cursor moved somewhere else. You can still get around editing the chars in the input by doing it fast enough or forcefully clicking on the input and doing it fast enough. Removing ngMask.js#L112-114 fixes the issue.

BBlackwo commented 7 years ago

I've got the same issue. I got around it by adding attribute mask-restrict="accept". Then it allows me to edit the wrong input. Could this please be fixed.