material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.42k stars 3.08k forks source link

[TextInputLayout + AutoCompleteTextView] Dialog doesn't show on click when icon is hidden #4365

Open memostark opened 3 weeks ago

memostark commented 3 weeks ago

Description: When you have an AutoCompleteTextView with android:inputType="none" (similar to a Spinner) and hide the end icon of the TextInputLayout using app:endIconMode="none" then the dropdown menu doesn't show on click anymore.

Expected behavior: The expected behavior is to see the menu on click otherwise the view is not usable.

Minimal sample app repro:

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/language_box"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:labelFor="@id/spinner_language_from"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
                app:endIconMode="none"
                app:hintEnabled="false">
                <AutoCompleteTextView
                    android:id="@+id/spinner_language_from"
                    android:layout_width="60dp"
                    android:layout_height="wrap_content"
                    android:inputType="none"/>
</com.google.android.material.textfield.TextInputLayout>

Android API version: 34

Material Library version: 1.12.0

Device: Pixel 8 Emulator