mdb-checkbox with id fails


Topic: mdb-checkbox with id fails

itay pro asked 5 months ago

Expected behavior

Checkbox should toggle

Actual behavior

Adding id="whatever" to an mdb-checkbox prevents toggling

Resources (screenshots, code snippets etc.)


Arkadiusz Idzikowski staff commented 5 months ago

Thank you, we will take a closer look at that. Please try this code, it should work correctly when you add input binding:

<mdb-checkbox [id]="'whatever'">Checkbox</mdb-checkbox>


itay pro commented 5 months ago

Works Please update


Arkadiusz Idzikowski staff answered 5 months ago

In this case you should use this version:

<mdb-checkbox [id]="'whatever'">Checkbox</mdb-checkbox>

We need to take the value from id input and use it as an attribute of the internal input element. If you add id without the [], then it will be added directly to the mdb-checkbox element.


itay pro commented 5 months ago

OK..............


Please insert min. 20 characters.
Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: 9.2.0
  • Device: NA
  • Browser: NA
  • OS: NA
  • Provided sample code: No
  • Provided link: No