Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Why does angular checkbox gets toggled even if I provide value as false?

In react

<input type='checkbox' checked={true} />

makes the checkbox non toggleable.

However the same in angular makes it toggleable?

<input type='checkbox' [checked]=true />

My use case is multi select dropdown with an max selection value in it. So if the selection is maxed I shouldn't let the user select an option.

Currently I've made it using disabled option something like this.

<input type="checkbox" [name]="option.label" [checked]="option.isSelected"
               [disabled]="!option.isSelected && max === selected.length"
               (change)="toggleSelectedItem(option.id)">

But I would like to know the reason behind such behaviour in angular? By such behaviour I mean in react if the checked attribute is set to true it doesn't allow user to check or uncheck the item which is what is expected. Why isn't it the case with angular?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!