MUI - Copying text inside ListItemText

Viewed 38

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>
1 Answers

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;
}
Related