-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TreeView] Label text is not selectable #9958
Comments
@cryzer12 The prevent text selection was made a default behavior in mui/material-ui#22846 by @joshwooding. You can disable it following this composition example: https://next.material-ui.com/components/tree-view/#contentcomponent-prop, removing the call to |
@oliviertassinari, |
I could find the origin of the issue, it's the same one as mui/material-ui#24096: The behavior has changed in mui/material-ui#21695. cc @joshwooding |
@cryzer12 What's your use case for allowing text selection? |
Interesting, looks like we need to revisit that logic. |
@oliviertassinari, |
@cryzer12 What do you mean? |
@oliviertassinari I have the exact same problem as the OP: we need to allow users to select text within the Tree List label. I cannot override the Is there a workaround? |
I'm having the same issue. @oliviertassinari, my scenario is that I'm building a JSON-like object viewer, and I'd like to be able to select the text from either the keys or values. If I disable JavaScript using the Chrome Dev Tools, I can select the text. Do you have any pointers or tips on where to start if I want to take a look at this? |
@oliviertassinari is there any update regarding this issue? |
@oliviertassinari is there any update regarding this issue? We need to enable use select on Tree label. |
Hi @oliviertassinari , we also need the text selection. It seems that the reason is due to the focus management is changed in v5, the focus is always on the ul in the outermost and you manage the child focus by aria-activedescendant, so we can't select the text without any focus in li. My workaround is to temporarily change this part of the logic to the v4 version. But I don't think this is a good way to solve this issue, do you have any plan to fix it in v5? |
Also need this...any updates? |
How did we do @cryzer12? |
Summary
(Text label doesn't user select in v5)
Hi, I had a case in which it was necessary to copy the contents of the TreeItem, now this is not possible and it is blocked using JavaScript, I tried to change the behavior by disabling preventSelection to the onDownMouse event inside the custom ContentComponent in the TreeItem, but it did not help, is there a solution?
The text was updated successfully, but these errors were encountered: