[KeyFilter] number and integer issue
Hello
Would you please check why KeyFilter for number and integer accepts -9---989 and ----------------
is that normal or we should implement our custom number and integer validator
Thanks for the great effort
Because the KeyFilter is based on regular expression testing and predefined mask for pint or int pattern is insufficiently defined.
My opinion is that this issue is bug.
It is an expected behavior. Currently in default mode, typing checks the key only. If you want to validate whole value on typing, you can use pValidateOnly attribute. In addition, keyfilter with validateOnly attribute don't support default patterns such as 'int', 'num' etc. You need to write custom pattern. We'll add this to Keyfilter's documentation. Exp patterns for;
positive 'int' values: /^\d+$/
positive and negative 'int' values: /^(-?|+?)\d+$/
https://www.primefaces.org/primeng/#/keyfilter
It is an expected behavior. Currently in default mode, typing checks the key only. If you want to validate whole value on typing, you can use pValidateOnly attribute. In addition, keyfilter with validateOnly attribute don't support default patterns such as 'int', 'num' etc. You need to write custom pattern. We'll add this to Keyfilter's documentation. Exp patterns for;
positive 'int' values:
/^\d+$/positive and negative 'int' values:/^(-?|+?)\d+$/https://www.primefaces.org/primeng/#/keyfilter
@mertsincan so, is there any chance to apply an additional pattern when using keyfilter with validateOnly attribute? I cannot find anything in the mentioned documentation yet...
The background is: I'm trying to combine a regex keyfilter for validating an IPv4 address but in addition to that i don't want to allow any inputs except of "[0-9.]" in first place (similar to an input mask).