Skip to content

[TextInputLayout] Collapses on small device when showing keyboard. #1480

Open
@Digipom

Description

@Digipom

Description: TextInputLayout collapses when expanding the keyboard on a smaller device, when that field is inside a dialog.

Expected behavior: Should not collapse.

Source code: The code snippet which is causing this issue. Please consider attaching a minimal sample app that reproduces the issue.

<com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="16dp"
    app:endIconMode="clear_text">

    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textCapSentences" />

</com.google.android.material.textfield.TextInputLayout>
        Objects.requireNonNull(dialog.getWindow()).setSoftInputMode(
                WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

It seems related to the setSoftInputMode() call, which I'm using to show the keyboard.

Android API version: 23, 29

Material Library version: Reproduced on 1.1.0, 1.2.0-rc-1 and 1.3.0-alpha-1

Device: Nexus 5 emulator running API 23 and API 29

Happens both with and without android:windowSoftInputMode="adjustPan".

https://trello-attachments.s3.amazonaws.com/53ade59a2a84a43be5b64df0/5f0c75af8a5d2d8f5fed8dc9/b327a9e68beebdd9bdad27025eb361cc/rename_bug.mp4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions