This is a migrated thread and some comments may be shown as answers.

Kendo ComboBox TypeError when hitting enter on an invalid Value

3 Answers 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
IT Dept
Top achievements
Rank 1
IT Dept asked on 18 Jul 2019, 05:19 PM

We have a Kendo ComboBox configured as the following:

<ComboBox
      loading={isLoading}
      placeholder="Enter item number.."
      data={sourceItems}
      allowCustom={false}
      filterable={true}
      onFilterChange={value => {
        const userInput: string = value.filter.value;
        setComboBoxValue(userInput);
        userInput.length >= 1 && filterData(userInput);
      }}
      onChange={value => {
        handleComboBoxChange(value.target);
      }}
      itemRender={(li, itemProps) => {
        const item: IItem = itemProps.dataItem;
        let itemChildren = null;
 
        if (item.action === 'default') {
          itemChildren = (
            <span>
              {item.itemNumber} - {item.description}
            </span>
          );
        }
        return React.cloneElement(li, li.props, itemChildren);
      }}
      value={comboBoxValue}
    />

 

But there's a bug: When you start typing a value that doesn't match any of the autocomplete items it will throw this error in the browser console:

onloadwff.js:71 Uncaught TypeError: Cannot read property 'type' of undefined
    at e.setFieldValue (onloadwff.js:71)
    at HTMLFormElement.formKeydownListener (onloadwff.js:71)

 

I'm now unsure what will happen if/when this gets fixed and if other parts of my application will need to handle these invalid values or not.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 19 Jul 2019, 07:42 AM
Hello, Eric,

Thank you for the code.

I tried to reproduce the same error, but to no avail.

Is it possible to share an example reproducing the same error.

Also, is there a pops that if it is remove the error disappears. This can leads us in the right direction.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
IT Dept
Top achievements
Rank 1
answered on 22 Jul 2019, 06:36 PM
Is there some way I can create a shareable example in the Kendo Dojo or equivalent?
0
Stefan
Telerik team
answered on 23 Jul 2019, 09:18 AM
Hello, Eric,

Yes, in KendoReact we use Stackblitz, it is similar tool as the Dojo.

https://stackblitz.com/

Any of our demos can be opened in StactBlitz and be used as a starting point when making an example:



Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
IT Dept
Top achievements
Rank 1
Answers by
Stefan
Telerik team
IT Dept
Top achievements
Rank 1
Share this question
or