Checkbox and radio invalid styles are not applied correctly #17303
Labels
Component: Theme
Issue or pull request is related to Theme
Status: Pending Review
Issue or pull request is being reviewed by Core Team
Milestone
Describe the bug
Angular gives the
p-checkbox
andp-radiobutton
elements the classng-invalid
andng-dirty
but the css selector seems to be assuming it for styleClass instead. Therefore when the form control is invalid and dirty it never gets a red border. The example on the radiobutton page for invalid also doesn't match the actual demo(ng-invalid ng-dirty
is applied on class in the code example but applied on styleClass in the demo) but it does match correctly for the checkbox.Pull Request Link
No response
Reason for not contributing a PR
Other Reason
Not sure where to fix the examples.
Reproducer
https://stackblitz.com/edit/github-qs8ey29q?file=src%2Fapp%2Fapp.component.html
Environment
I'm using Angular 18.2.13 and PrimeNg 18.0.2 but it still seems to be an issue on Primeng 19 as well.
Angular version
18.2.13
PrimeNG version
v19
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
In the stackblitz example the radio buttons and checkbox are already invalid. Press the button to mark them dirty and they won't be bordered in red.
Expected behavior
The border of the radio buttons and checkbox should be red when the controls are marked as dirty.
The text was updated successfully, but these errors were encountered: