angular-input-masks
angular-input-masks copied to clipboard
Pasting whole number results in wrong formatting when decimals are used.
We are using ui-money-mask directive with 2 decimals.
When the user pastes whole numbers like 123456 in the text box, the last 2 digits are taken to be decimals by the directive. So the value in the text box becomes $ 1234.56 which is not what the user expects. This is clearly a defect for us but I am not sure if you would consider this as a general defect or as designed?
Can you write a test case to show the wrong behaviour?
The same behavior occurs for the ui-number-mask. I've created a jsfiddle as example, because unfortunately I don't have the know how to write test cases in javascript
I had to resort to adding my own code inside a ng-paste
directive on the same element to circumvent this issue.
https://docs.angularjs.org/api/ng/directive/ngPaste