Want a list item to be a link. If I specify button={true} for a ListItem, would expect href attribute to work as it does within a Button. Instead, href property appears to do nothing in this context.
For a ListItem with button={true}, would expect I could use href property to specify a link.
If I specify a ListItem with button={true} and include an href property to specify a link, nothing happens when I click on the ListItem. I.e. href property doesn't work for ListItems, even when button={true}
1.
2.
3.
4.
| Tech | Version |
|--------------|---------|
| Material-UI | |
| React | |
| browser | |
| etc | |
@srubin20170623 For the sake of HTML5 compliance, we force the button to render as a div. You need to force the rendering of a link:
<ListItem button component="a" href="#option2">
<ListItemText primary="Spam" />
</ListItem>
Most helpful comment
@srubin20170623 For the sake of HTML5 compliance, we force the button to render as a div. You need to force the rendering of a link:
https://codesandbox.io/s/4jkym3mq74