material-components / material-components/material-components-android
[MaterialAutoCompleteTextView] Dropdown height calculated incorrectly when added to a dialog
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 17.4k
- Forks
- 3.2k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Description:
When MaterialAutoCompleteTextView is added as a custom view to a dialog, the dropdown height does not account for the IME. A good portion of the dropdown items end up below the keyboard.
Expected behavior:
In this screen recording, the last few items in the dropdown are obscured by the keyboard, but should ideally not happen.
https://user-images.githubusercontent.com/646253/225210028-4d8b37eb-94f8-4f44-8be2-952f7e4ec1d4.mp4
Source code:
This can be reproduced with a small modification to the official catalog app in this repo.
- Clone this repo (I was testing against
masterat commit 359580b6c1160301967ebdededb1011c1133b42c) - Apply this patch: https://gist.github.com/chenxiaolong/e3e163d1e1b8b3cb7a56f4fb4af19131
- This modifies the "Custom View" dialog sample to have a
MaterlaAutoCompleteTextViewand increases the number of dropdown elements to 25
- This modifies the "Custom View" dialog sample to have a
- Navigate to Dialogs -> Demo -> Custom View
- Tap on the text box
- The dropdown items are obscured by the keyboard
Android API version: 33
Material Library version: Both 1.8.0 and master (commit 359580b6c1160301967ebdededb1011c1133b42c) exhibit this issue
Device: Google Pixel 7 Pro (Android 13 build TQ1A.230205.001.D2)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem in der offiziellen Katalog-App über Dialogs -> Demo -> Custom View, mit der beschriebenen Änderung an MaterialAutoCompleteTextView und dem Android API 33-Setup. Beginne bei der Berechnung der Dropdown-Höhe von MaterialAutoCompleteTextView und untersuche, wie die IME berücksichtigt wird; abgeschlossen ist die Untersuchung, wenn die Dropdown-Elemente oberhalb der Tastatur im Dialog sichtbar bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android, java
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100