Sitelet https://web.archive.org/web/20201022112335/https://github.com/mui-org/material-ui/issues/22166
Skip to content
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] Unclickable area between text input and endAdornment #22166

Open
FlorisWarmenhoven opened this issue Aug 12, 2020 · 10 comments
Open

[Autocomplete] Unclickable area between text input and endAdornment #22166

FlorisWarmenhoven opened this issue Aug 12, 2020 · 10 comments

Comments

@FlorisWarmenhoven
Copy link

@FlorisWarmenhoven FlorisWarmenhoven commented Aug 12, 2020

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When using the Autocomplete in combination with the TextField, there is a small 'deadzone' where clicking will not trigger the list of options to appear. This deadzone is located between the label text and the end adornment ('arrow down').

Expected Behavior 🤔

I expect the user to be able to click anywhere within the border/outline of the textfield to open the list of selectable options.

Steps to Reproduce 🕹

Steps:

  1. Open https://material-ui.com/components/autocomplete/
  2. Click on the right of the 'combobox' text inside of the textfield -> the list of options should open
  3. Keep clicking and moving the mouse cursor towards the right. The list of options will keep appearing/closing until you reach the deadzone. The deadzone is about 30-40 pixels.

Context 🔦

Users of our application report that sometimes the menu won't show. That's because they're clicking in the deadzone.

Your Environment 🌎

Live environment on the MUI Docs page.

Additional

I'm not an expert developer, but perhaps the solution would be as simple as wrapping both the adornment and the text input in a div and putting the onClick handler on there. Then again, I don't know what the component structure looks like so feel free to disregard.

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Aug 13, 2020

@FlorisWarmenhoven How do you reproduce the issue?

@FlorisWarmenhoven
Copy link
Author

@FlorisWarmenhoven FlorisWarmenhoven commented Aug 16, 2020

WvlclOpfqP

Sorry for the delay. As you can see in the above GIF, I am clicking from left to right (continuously clicking). There is an area that does not show/hide the popup.

@Waynetron
Copy link

@Waynetron Waynetron commented Aug 20, 2020

As a workaround, I found that with openOnFocus enabled you will get the behaviour you desire.
Presumably as a side effect of the input being focused. But it may be enough for you until the issue is resolved.

@FlorisWarmenhoven
Copy link
Author

@FlorisWarmenhoven FlorisWarmenhoven commented Aug 20, 2020

@Waynetron Thank you. That's a perfect workaround for my usecase.

@hkurra
Copy link

@hkurra hkurra commented Aug 21, 2020

@oliviertassinari @FlorisWarmenhoven I have committed the change to fix this issue, I have followed contributing guide but still if you can let me know about the changes(correct or not).after that I will raise the PR
8d9d11c

@mnajdova
Copy link
Member

@mnajdova mnajdova commented Sep 13, 2020

@hkurra sorry for the late response. The proposed change looks good to me, feel free to open a PR if you would like to.

@hkurra
Copy link

@hkurra hkurra commented Sep 16, 2020

@mnajdova Sure will do asap, I have raised it earlier but it has some problem, related to test case, will look into that and raise the PR again. I have found I need to consider other things like commit message format etc.
will consider everything and raise a PR

@jedwards1211
Copy link
Contributor

@jedwards1211 jedwards1211 commented Sep 21, 2020

shouldn't anywhere on the border, not just the input itself, respond to a click?
In other words the root element handles the click but the clear icon button would stop propagation?

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 22, 2020

@jedwards1211 I'm not sure about the conflict it will create with the other element inside the combo box, like the icons, clear icon or the tags.

@jedwards1211
Copy link
Contributor

@jedwards1211 jedwards1211 commented Sep 22, 2020

@oliviertassinari for sure it would be a bit of a challenge...actually the simplest way would be for the root listener to only activate if the target is the input or one of its ancestors, since that would exclude the icons and tags.

It kinda reminds me of an annoying little quirk in the old CircleCI UI, they had an gear icon button for project settings, but for a long time only the icon itself was clickable, not the button :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.