Reputation: 161
I am not able to copy text inside component from material UI. What I can change in order to do that?
<ListItem key={staff._id}
className={background_colour}
onClick={par(set_viewing, component, staff)}>
{checkboxes}
{avatar}
**<ListItemText primary={text} />**
<Button onClick={() => {navigator.clipboard.writeText(email)}} size='small' variant="string">{email}</Button>
{renderActionButtons}
</ListItem>
Upvotes: 1
Views: 1098
Reputation: 5539
You should add custom className
for ListItemText
<ListItemText className="select_text" primary={text} />
so you can override MUI style
style.css
.select_text {
user-select: text !important;
}
Upvotes: 1