material-components / material-components/material-components-android

[MaterialAutoCompleteTextView] Dropdown height calculated incorrectly when added to a dialog

Offen
#3,307 2 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug Widget: TextView
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.

  1. Clone this repo (I was testing against master at commit 359580b6c1160301967ebdededb1011c1133b42c)
  2. Apply this patch: https://gist.github.com/chenxiaolong/e3e163d1e1b8b3cb7a56f4fb4af19131
    • This modifies the "Custom View" dialog sample to have a MaterlaAutoCompleteTextView and increases the number of dropdown elements to 25
  3. Navigate to Dialogs -> Demo -> Custom View
  4. Tap on the text box
  5. 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

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Ö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

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.