I am currently working with Material UI's ToggleButton and ToggleButtonGroup components. However, I'm facing an issue where the ToggleButton remains highlighted even after clicking on another button in the group. While the buttons are registering input correctly, I would like them to only show as selected when clicked. Can you help me figure out how to make this work?
handleToggleChange = (date, newValue) => {
this.setState({
[date]: newValue
})
}
<ToggleButtonGroup onChange={(e, value) => this.handleToggleChange("date", value)} name="date"
id="date-select" exclusive={true} size="small">
<ToggleButton value="today">Today</ToggleButton>
<ToggleButton value="tomorrow">Tomorrow</ToggleButton>
<ToggleButton value="week">This week</ToggleButton>
</ToggleButtonGroup>