Last Updated: 23 Jun 2020 07:39 by ADMIN
Release 2.15.0
Created on: 19 Jun 2020 10:32
Category: DropDownList
Type: Bug Report
Dropdown does not open upon click on the main element when component is inside a <label>

Clicking on the <label> opens the dropdown, but clicking on its main element does not

Selected value: @selectedValue
<br />
<label>some label for the dropdown, open it and test whether clicking outside closes it
    <TelerikDropDownList Data="@myDdlData" TextField="MyTextField" ValueField="MyValueField" @bind-Value="selectedValue">

@code {
    //in a real case, the model is usually in a separate file
    //the model type and value field type must be provided to the dropdpownlist
    public class MyDdlModel
        public int MyValueField { get; set; }
        public string MyTextField { get; set; }

    IEnumerable<MyDdlModel> myDdlData = Enumerable.Range(1, 20).Select(x => new MyDdlModel { MyTextField = "item " + x, MyValueField = x });

    int selectedValue { get; set; } = 3; //usually the current value should come from the model data