Completed
Last Updated: 16 Jan 2020 18:17 by ADMIN
Christoph
Created on: 12 Jan 2019 18:53
Category: CheckBox
Type: Feature Request
8
Support checkboxes without id attribute

Today the checkbox styles work only if we place the label behind the input and connect them use id + for attribute:

        <input type="checkbox" id="ch1" class="k-checkbox" checked />
        <label class="k-checkbox-label" for="ch1">Checkbox 1</label>

Problem:

While it works most times, it quite difficult to ensure a unique id inside an angular component. We have to ensure, it's unique over all currently rendered components.

A clean solution would require something like this:

// MyComponent
let componentIndex = 0;

class MyComponent {
  checkboxId: `my-component-${componentIndex++}-checkbox`;
}

// Template
        <input type="checkbox" [id]="checkboxId" class="k-checkbox" checked />
        <label class="k-checkbox-label" [for]="checkboxId">Checkbox 1</label>

Feature request:

Support implicit label association like so:

<label class="k-checkbox"><input type="checkbox" /> My label</label>

2 comments
ADMIN
Carl
Posted on: 16 Jan 2020 18:17

Hello folks!

As an update here, with the R1 2020 release we introduced the Kendo UI for Angular Checkbox directive. This is a part of the 6.4.0 release of our Inputs package. With the introduction of this directive there is way more flexibility with our checkboxes, including the desired behavior as mentioned in this thread!

I'll go ahead and mark this as complete :)

Regards,
Carl
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Dimiter Topalov
Posted on: 14 Jan 2019 10:04
Hello Christoph,

Thank you for sharing your idea. Indeed, providing the developers with the option for wrapping the checkbox within the label element will be a valuable enhancement to our current functionality that requires all labels to be associated to their checkboxes via the id attribute.

We will track the customer demand here, and consider implementing this feature for our next official release, scheduled in May or a subsequent release, depending on the interest.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.