Open Xunrel opened 4 years ago
@Xunrel Hello~ https://codesandbox.io/s/muidatatables-custom-toolbar-umbig
return false -> return []
render: v => {
console.log("Render: ", v[0], v[1], this.state.ageFilterChecked);
if (v[0] && v[1] && this.state.ageFilterChecked) {
console.log("Min max");
return [`Min Age: ${v[0]}`, `Max Age: ${v[1]}`];
} else if (v[0] && v[1] && !this.state.ageFilterChecked) {
console.log("Min max");
return [`Min Age: ${v[0]}, Max Age: ${v[1]}`];
} else if (v[0]) {
console.log("Min");
return `Min Age: ${v[0]}`;
} else if (v[1]) {
console.log("Max");
return `Max Age: ${v[1]}`;
}
return [];
},
Expected Behavior
Removing the filter from the filter dialog should not display any chips
Current Behavior
Removing the filter from the filter dialog shows empty chips
Steps to Reproduce (for bugs)
https://codesandbox.io/s/muidatatables-custom-toolbar-jk556
Possible workaround
If I return an empty array within the render function of customFilterListOptions as the fallback, it works as expected. Don't know if this was intended or not.