-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Autocomplete] Can't select helper text content #26153
Comments
From looking into the code, the reason why this is happening is because the root of the autocomplete focuses the We have two options:
|
Option 1 sounds better. After #25365, we will be able to repurpose diff --git a/packages/material-ui/src/Autocomplete/Autocomplete.js b/packages/material-ui/src/Autocomplete/Autocomplete.js
index 31bde4c434..b5a10c7c74 100644
--- a/packages/material-ui/src/Autocomplete/Autocomplete.js
+++ b/packages/material-ui/src/Autocomplete/Autocomplete.js
@@ -579,7 +579,6 @@ const Autocomplete = React.forwardRef(function Autocomplete(inProps, ref) {
ref={ref}
className={clsx(classes.root, className)}
styleProps={styleProps}
- {...getRootProps(other)}
+ {...other}
>
{renderInput({
id,
@@ -588,6 +587,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(inProps, ref) {
size: size === 'small' ? 'small' : undefined,
InputLabelProps: getInputLabelProps(),
InputProps: {
+ ...getRootProps(),
ref: setAnchorEl,
className: classes.inputRoot,
startAdornment, But yeah, I think that we can hold, for now. |
I also encountered this issue. My workaround is to disable propagation of onClick and onMouseDown event from
|
Current Behavior 😯
When providing a
helperText
using theAutocomplete
component with theTextField
component, it's not possible to select the actual helper text content.Expected Behavior 🤔
I expect the help text content to be selectable. As it works with just using the
TextField
component.Working example: https://codesandbox.io/s/material-demo-forked-l8rom
Non-working example: https://codesandbox.io/s/material-demo-forked-102o6
Steps to Reproduce 🕹
Steps:
Context 🔦
I am trying to select the help text content that belongs to the text field.
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: