-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Describe the bug
The Keyfilter Android implementation differs from all other platforms, that also behaves differently when using it with regex.
Usually, on every input, the full content of the input gets checked against the regex. For Android specifically though, every single character gets matched against the regex separately.
Example:
Regex: ^[a-z]\d$
Input: a1
Expected behaviour (and current behaviour on all non-Android platforms): Is correct & matches regex (input doesn't get blocked with validationOnly=false)
Behaviour on Android: Is invalid, since neither "a" nor "1" matches the regex (typing the "a" would already get blocked)
Note: The provided reproducible obviously only exerts the described behaviour if run on Android.
Pull Request Link
Reason for not contributing a PR
- Lack of time
- Unsure how to implement the fix/feature
- Difficulty understanding the codebase
- Other
Other Reason
No response
Reproducer
https://stackblitz.com/edit/github-lctj1mij-mcf7drqq?file=src%2Fapp%2Fapp.component.ts
Environment
On Android devices (whenever isAndroid returns true)
First observed on a Pixel 9 with Android 15, reproduced in multiple emulators with Android 13-16
Angular version
21.0.0
PrimeNG version
v20
Node version
No response
Browser(s)
Chrome for Android, Capacitor App (Webview)
Steps to reproduce the behavior
- Implement a input with a complex regex (=multi part, eg. ^[a-z]\d*$) keyfilter and validationOnly=false
- Try to input text on Android matching the regex (eg. "a1" for the given regex)
Expected behavior
Input should be possible, as long as the full input matches the regex