-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
mat-autocomplete: panel is shifted way too high in small devices (mobile) #11869
Comments
@julianobrasil from what I can gather from the gif, there probably is more space to show the menu above than below. It's being cut off in your case, because the toolbar's |
You're completely right, @crisbeto. I'm closing this. |
@crisbeto, unfortunately, I'm reopening this one. I've tested it again (changing the z-index so the toolbar became behind the autocomplete panel). Notice in the gif below that the panel is opened with 5 options. After the virtual keyboard is shown and the panel is shifted upwards, one of the options (the very first one) is hidden at the top of the browser (chrome in Android). If the user wishes to select the first option (which I think it's the most probable situation), he/she must close the panel first, using Android's footer buttons. |
We should be able to resolve that case by enabling pushing for the autocomplete, however doing so is on hold until #11628 gets in. |
@crisbeto Enabling push for autocomplete by setting I can submit a PR if this is how it is supposed to act. |
@kwkelly that's how pushing is supposed to work. If you add |
@crisbeto wouldn't that mean that in this event (an autocomplete near the top on mobile devices with the keyboard opened):
An alternative approach would be to add a class like mat-autocomplete-smallheight whenever the viewport height is <300 or so (256 + some the input + some margin) that overrides the max-height to 96 (2xAUTOCOMPLETE_OPTION_HEIGHT). It's not ideal, but it's the only thing I could think of to address those two points too. Would you folks be open to this approach? If so, it might be something useful to more than just mat-autocomplete, so maybe instead of a state class, a class further up the dom tree would be better. |
Bug, feature request, or proposal:
Bug: the overlay panel position is bugged in small devices, when pushed up by the virtual keyboard on mobile devices.
What is the expected behavior?
If there's no space to show the autocomplete neither above, nor bellow the associated input, maybe it's better to do nothing, just leaving the panel where it was initially opened (or maybe it's better to push it downwards).
What is the current behavior?
Notice how the panel just goes off the screen
What are the steps to reproduce?
There's no special steps to reproduce it. Just open an autocomplete panel in a small screen.
What is the use-case or motivation for changing an existing behavior?
UX in small devices
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
Maybe related to #6965
cc: @crisbeto
The text was updated successfully, but these errors were encountered: