jaridmargolin / formatter.js

Format html inputs to match a specified pattern
http://firstopinion.github.io/formatter.js
2.48k stars 235 forks source link

Disable caret positionning on resetPattern #30

Closed fdaugan closed 10 years ago

fdaugan commented 10 years ago

Main issue : there is no way to format the input when it is updated with 'val()' function. Calling 'resetPattern' is the good solution, unfortunally the input get focus; this cause troubles on IE7 (inputs are blinking continuously) and on modern browsers since focus are stolen. So I disabled the caret manipulation on 'resetPattern'

brianpeiris commented 10 years ago

+1 to this. Did not expect resetPattern to steal focus.

jaridmargolin commented 10 years ago

Much appreciated on yet another PR :D Would love to see a test implemented to confirm the fix and avoid and future regression.

https://github.com/firstopinion/formatter.js/blob/master/test/formatter.js#L289

Thanks again!