Kendo-angular: Exception in filterable, non-primitive, no-custom ComboBox component

Created on 10 Sep 2018  路  5Comments  路  Source: telerik/kendo-angular

I'm submitting a...

  • Bug report

Current behavior

Pressing Enter in a ComboBox for non-primitive values when the result list is empty raises the following exception:

Error: Expected value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection

The component is rendered unusable after that.

Expected behavior

Nothing should happen.

Minimal reproduction of the problem with instructions

The bug is found even in the official example code in the documentation for filterable ComboBox. Note that the exception is not visible when running the example from the docs. It has to be opened in StackBlitz.

To reproduce: type in some random value (say, 12345) that results in the list of items becoming empty. Wait a second for it to actually become empty. Then, press Enter. The exception is raised and the component misbehaves after that.

I have forked the example code verbatim here: https://stackblitz.com/edit/angular-m6ht7c

Bug dropdowns

All 5 comments

Fix available in latest dev version - v3.3.1-dev.201811060952

Shipped in v3.4.0 of the @progress/kendo-angular-dropdowns package.

The issue still exists when adding

[allowCustom]="true"

https://stackblitz.com/edit/kendo-combobox-angular

The issue in the shared example is caused by not specifying a valueNormalizer function. When the ComboBox is configured to read data from objects (i.e. a textField and a valueField are specified) you need to normalize the custom value before persisting it, as the typed value represents only the textField, the valueNormalizer should provide a complete object (with both textField and valueField). Refer to this example. And to this article in the docs.

@dimitar-pechev thanks! it works now.

Was this page helpful?
0 / 5 - 0 ratings