Comments (1)
It looks like the check to see if a decimal separator needs to be added needs an additional check to see if it's a zero, otherwise it adds a second decimal - this then causes issues when the later formatters run. The same issue occurs for any number where the next digit is a zero (505,000 for example becomes 0.50 when you delete the first 5).
This seems to fix it:
if (inputValue[0] === "0" /* MaskExpression.NUMBER_ZERO */ &&
inputValue[1] !== "0" && /*This seems to fix it */
inputValue[1] !== decimalMarker &&
inputValue[1] !== this.thousandSeparator) {
// eslint-disable-next-line no-param-reassign
inputValue =
inputValue.length > 1
? inputValue.slice(0, 1) +
decimalMarker +
inputValue.slice(1, inputValue.length + 1)
: inputValue;
this.plusOnePosition = true;
}
from ngx-mask.
Related Issues (20)
- Adjust documentation about custom patterns HOT 2
- ngx-mask appends zero's when using a date mask in combination with leadZeroDateTime=true HOT 1
- NgxMaskPipe keeps previous configs when transform() called HOT 1
- Cursor change place when try to delete characters HOT 1
- Chrome, Unexpected behavior with input + mask HOT 1
- Mixed Type is not respecting the mask. HOT 2
- Not able to add a zero value when using separator mask HOT 1
- Option for replacing the zero instead of a number after the separator
- Have max length checking for input HOT 2
- Dynamically placeholder value
- Issue with updating ngModel value of Angular input and mask
- Cursor jumps on multi mask
- dynamically [mask] removes Special Characters even if [dropSpecialCharacters] ="false"
- placeHolderCharacter doesn't work with keepCharacterPositions
- Selecting one or multiple values and then replacing it results in strange behaviour HOT 1
- It is impossible to enter more than 4 digits in input, when thousandSeparator="," is used on input HOT 4
- Clearing input field in Firefox with backspace key using a mask not clearing input correctly
- I want to use both period ('.') and comma (',') as input
- Mask with or (||) does not work.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-mask.