Closed FaraKahir2 closed 6 years ago
it'd be a great improvement.
In the /src/input.service.js on line 20 add to the top of the function:
InputService.prototype.applyMask = function (isNumber, rawValue) { if(rawValue == '') { // <-- checking if you cleared it. return ''; // <-- this is returning empty string to have it blank } else { ......original code ..... } }
The fix by @jans-y does not seem to work in all cases. I can only clear the value by leaving the field, focusing it again and then pressing space. It does not even work with backspace / delete. (Tested in Chrome)
Setting an empty value to default 0 is a critical issue since the value 0 has a semantical meaning. The empty field should set the model to NULL (as usual)!
How to empty the input field if it's a non-required field?? Need an urgent fix otherwise the component is not useable without hacking the code. :(
I will prioritize this issue and do it asap.
Fixed in version 4.4.0.
Hey @cesarrew. We should probably have an option, allowBlank. The way before 649cd8734 was how we intended we were using it. makes sense?
//ysf
@cesarrew would it be possible to add an option for the value the field should be reset to if it is cleared? The default could remain null, but it'd be nice to be able to override it with 0 or another value.
On clearing an input field I would like the text to be blank rather than default to '0' Ideally, I would like to be able to configure this in the options settings. At the moment even when I delete the 0, if still says zero.