Having two consecutive spaces in an item name for ListViewComponent breaks react when selected
kenkit opened this issue · 4 comments
I have the following setup, when the callback is triggered after the user selects an item, the event does not have a data property set.
event.data <=== is empty
but everything else including the item seems okay.
listTemplate(data) {
return (
<div className="e-list-wrapper e-list-multi-line e-list-avatar">
<img className="e-avatar e-avatar-circle" width="50px" src={data.image}/>
<span className="e-list-item-header"><b>{data.text}</b></span>
</div>
);
}
<ListViewComponent template={this.listTemplate} cssClass='e-list-template' showHeader={false} height={200} dataSource={this.state.datasource} select={this.handleSelect.bind(this)} />
Even having a single space at the start is lethal
Hi kenkit,
We have checked with the reported issue in ListView and the event data is properly returned in the select event.
Refer to the sample.
https://stackblitz.com/edit/react-mzhbly-4dvhzk?file=index.js
Please modify the above sample to reproduce the issue along with the exact package version so that we can check and serve you better.
Nice.. let me see if I can reproduce it from there
After doing some tests I think my bug was missing the fields parameter, but I still don't get how it works without it.
I'll investigate further and get rid of the workarround I implemented after adding it.
fields={this.fields}