I'm submitting a ... (check one with "x")
[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior
The p-inputmask component is always marked as valid even the input does not match the mask pattern.
<p-inputmask styleclass="form-control" ng-reflect-required="false" ng-reflect-mask="99:99:99:99" ng-reflect-slot-char="dd:hh:mm:ss" ng-reflect-auto-clear="false" ng-reflect-input-id="meter_cycle" ng-reflect-style-class="form-control" ng-reflect-disabled="false" ng-reflect-unmask="false" ng-reflect-name="meter_cycle" ng-reflect-is-disabled="false" class="ng-valid ui-inputwrapper-filled ng-touched ng-dirty" ng-reflect-model="01:hh:mm:ss">
<input pinputtext="" class="form-control ui-inputtext ui-corner-all ui-state-default ui-widget ui-state-filled" ng-reflect-ng-class="form-control" id="meter_cycle" type="text" name="meter_cycle">
</p-inputmask>
Expected behavior
Decorate component with ng-valid if mask is not complete.
Angular version: 4.1.0
PrimeNG version: 4.1.3
We'll reopen if more users demand it.
Why do you close it? The sense of an input mask is to prevent incorrect user inputs. This also includes checking the mask being completed. I understand completeness must not be mandatory (e.g. license tags can be different: "A-BB1234" vs. "A-BB12").
BUT, there are clear uses cases where completeness is crucial like credit card numbers or the IBAN. A good solution would be to add an @Input to make completeness check controllable.
I have the same problem. The input is always marked as valid. You have to reopen this issue...
I have to agree here that you should be able to mark these fields as invalid. It kind of breaks the uniform behaviour of invalid field behaviour. If someone is submitting my form they have no idea it's because of the mask isn't complete because it still shows as valid visibly.
Still having the same problem , at the first time the p-inputMask work as expected I can see the state is invalid but after I enter any value of clear existing value the state still valid
PrimeNG version: 5.2.4
Any solution? I think they can reopen right? @cagataycivici
Reopen this. It's still a bug and it makes your inputMask element unusable. @cagataycivici
Fix this issue.
Reopen this issue. @cagataycivici
I have a input mask which is allow only numeric 999.99 pattern. but, user if enter only 12 then tab out which clearing all the cell value. But, the expected behaviour resut is 12.00. Is there any way to implement. Can you help me on this. ?
I can't use this control in this state
What the current status of this issue?
I found an interim solution via scss, I am using it, but I think it would be interesting for primeng to work for this validation to work on its own.
But for those who need an interim solution you can use this:
p-inputMask.ng-invalid.ng-touched {
input {
border: 1px solid #e17576;
}
}
p-inputMask.ng-valid.ng-touched {
input {
border: 1px solid green;
}
}
This solution only works if you set validations in your FormGroup...
I am still getting this Issue. If we set a formControl to the p-inputMask element. It is shown as valid even if the input is not complete.
I am getting this problem also. Please fix.
Still not working, primeng ver. 9.1.3. Please fix.
Most helpful comment
Reopen this issue. @cagataycivici