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

[TextInputLayout] Collapses on small device when showing keyboard.

Open
#1,480 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Good First Issue Widget: TextField
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**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.

```

```

```
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied TextInputLayout XML and the dialog window's setSoftInputMode call, then reproduce the collapse on the Nexus 5 emulator with Android API 23 and 29. Done means the TextInputLayout remains expanded when the keyboard is shown, including with and without adjustPan.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.