Hello,
I'm trying to create a stackblitz with a kendo-react-wrapper example showing a MultiSelect, but I get the following error:
Error in /turbo_modules/@progress/kendo-base-component-react-wrapper@2021.3.1112/dist/npm/index.js (47:32) Cannot read properties of undefined (reading 'call')
Here is the code and the link to stackblitz: https://stackblitz.com/edit/react-ts-9tttzc?file=index.tsx
Thank you.
Kind regards
import { MultiSelect } from '@progress/kendo-dropdowns-react-wrapper';
import * as React from 'react';
import { useRef, useState } from 'react';
import { render } from 'react-dom';
import './style.css';
export const App = (props) => {
const [value, setValue] = useState();
const ds1 = [
{ id: '1', descr: 'test1' },
{ id: '2', descr: 'test2' },
{ id: '3', descr: 'test3' },
{ id: '4', descr: 'test4' },
];
const listRef = useRef();
const changeHandler = (e) => setValue(e.sender.value());
const virtual = {
itemHeight: 26,
valueMapper: (options) => {
const indices = [];
const values = Array.isArray(options.value)
? options.value
: [options.value];
let ref = listRef.current as any;
let widget;
if (ref) {
widget = ref.widgetInstance;
}
if (values && widget) {
let index = 0;
widget.dataSource.data().forEach((x) => {
if (values.indxOf(x[props.dataValueField])) {
indices.push(index);
}
index += 1;
});
}
options.success(indices);
},
};
return (
<div>
<p>
<MultiSelect
ref={listRef}
dataSource={ds1}
dataValueField={'id'}
enable={true}
dataTextField={'descr'}
value={value}
change={changeHandler}
filter={'contains'}
valuePrimitive={true}
autoWidth={true}
virtual={virtual}
/>
</p>
</div>
);
};
render(<App />, document.getElementById('root'));