primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.44k stars 4.6k forks source link

p-inputMask always decorated as valid even if mask is not complete #3766

Closed ghost closed 7 years ago

ghost commented 7 years ago

There is no guarantee in receiving a response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeNG PRO Support where support is provided within 4 business hours

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.

`

`

Expected behavior

Decorate component with ng-valid if mask is not complete.

cagataycivici commented 7 years ago

We'll reopen if more users demand it.

ghost commented 7 years ago

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.

pablobello92 commented 6 years ago

I have the same problem. The input is always marked as valid. You have to reopen this issue...

gspeach commented 6 years ago

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.

malbarmavi commented 6 years ago

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

jsilveira2 commented 6 years ago

Any solution? I think they can reopen right? @cagataycivici

madvlad commented 5 years ago

Reopen this. It's still a bug and it makes your inputMask element unusable. @cagataycivici

hemendraub commented 5 years ago

Fix this issue.

madvlad commented 5 years ago

Reopen this issue. @cagataycivici

palmani commented 5 years ago

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. ?

hepple commented 5 years ago

I can't use this control in this state

talipovdaniyar commented 5 years ago

What the current status of this issue?

jsilveira2 commented 5 years ago

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...

midhunadarvin commented 5 years ago

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.

michaelakin commented 4 years ago

I am getting this problem also. Please fix.

michas84 commented 3 years ago

Still not working, primeng ver. 9.1.3. Please fix.

adeelbhaloo-tag commented 1 year ago

this is still not working! Primeng ver 15.2. Please reopen this issue