Closed marthrusk closed 5 years ago
Happens because it listens on Click and it is triggered twice. One for the span and one for the outside label. You could alter the behavior by conditionally call the onClick handler:
return React.cloneElement(li, {
...li.props,
onClick: (e) => (e.currentTarget === e.target) && li.props.onClick(e)
}, itemChildren);
It would depend on what is the target behavior to be achieved and kind of the template inside.
Multiselect has some problem with triggering onChange event when custom ItemRendering is enabled and contains input, for example checkbox. onChange event is triggered twice in 2.3.2 version. In version 1.2.0 it worked fine without any problem.
Follow this sample and then just copy paste my code below Kendo version: 2.3.2
Edit: solution to this is that onClick + onChange event on input must have this
onChange={(e) => { e.stopPropagation(); e.preventDefault() }}
onClick={(e) => { e.stopPropagation(); e.preventDefault() }}
https://www.telerik.com/kendo-react-ui/components/dropdowns/multiselect/custom-rendering/