- I'm facing an issue with adding the delete icon at the end of my chip.
- It works perfectly in the Material UI demo, but not in my own code.
- I've tried debugging, but I still can't pinpoint the problem. The icon is supposed to show up due to this line: deleteIcon={}
- Would changing the button tag to a chip tag be causing the problem?
- Here's a snippet of my code:
Not working: Check it out here
Working Demo: Try this demo instead
import DoneIcon from '@material-ui/icons/Done';
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
color="primary"
deleteIcon={<DoneIcon />}
/>
<chip
style={{ display: this.state.display ? "none" : "" }}
onClick={this.handleClickOpen}
color="primary"
deleteIcon={<DoneIcon />}
>
Open Menu
</chip>