telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
469 stars 218 forks source link

[DropDownList] Cannot clear the component value when valuePrimitive is set to true #4203

Closed georgi-sla closed 3 months ago

georgi-sla commented 9 months ago

Describe the bug Currently, when the DropDownList component is bound to complex data and the valuePrimitive property is set to true, trying to programmatically reset the value does not clear the value in the DropDownList.

To Reproduce

  1. Create a DropDownList component.
  2. Set the valuePrimitive property to true.
  3. Programmatically clear the value of the component.

Please, check out the following StackBlitz demo: https://stackblitz.com/edit/angular-gue7wn-ethzdj

Expected behavior Programmatically resetting the value that is bound to the DropDownList should reflect the changes in the component.

tswetti commented 3 months ago

The value in the StackBlitz example is not cleared programmatically because the new value ('') is not present in the data. To clear the value, set it to null - https://stackblitz.com/edit/angular-gue7wn-a8wbyn?file=src%2Fapp%2Fapp.component.ts