Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-checkbox has invalid markup when required="false" #17528

Open
1 of 4 tasks
nathanielbuck opened this issue Jan 29, 2025 · 0 comments · May be fixed by #17541
Open
1 of 4 tasks

p-checkbox has invalid markup when required="false" #17528

nathanielbuck opened this issue Jan 29, 2025 · 0 comments · May be fixed by #17541
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@nathanielbuck
Copy link

Describe the bug

<p-checkbox [required]="false" /> results in the markup <input type="checkbox" required="false" />, which actually indicates that <input> is required.

The expected HTML in this scenario is <input type="checkbox" />, as the lack of the required property is the proper indication that the input is not required.

Pull Request Link

No response

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/stackblitz-starters-pf6qupkm

Environment

macOS 15.3

Angular version

19.0.0

PrimeNG version

v19

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

Create a <p-checkbox> with required set to false.

Expected behavior

The required property is not present on checkbox inputs that are not required.

@nathanielbuck nathanielbuck added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 29, 2025
@navedqb navedqb linked a pull request Jan 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant