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

[TextInputLayout] hintEnabled set to false but hint top space is still claimed

Open
#1,113 12 comments 24 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Description:** Setting `app:hintEnabled="false"` properly hides the hint but keeps the top space where it would normally appear, causing misalignment of components.

**Expected behavior:**
The problem as seen in the Layout Inspector:
TextInputLayoutIssue
TextInputLayoutIssueMarked
Marked is the mentioned claimed space.

Also from the IDE preview:
With `app:hintEnabled="false"`
Screen Shot 2020-03-16 at 18 57 50

Without `app:hintEnabled="false"`
Screen Shot 2020-03-16 at 18 58 17

The expected behavior would have been basically the second the "without" visuals but without the animation and the hint.

**Source code:**
```

```

**Android API version:** From 23 up to recent

**Material Library version:** 1.2.0-alpha5

**Device:** Emulators, Pixel 3XL, Pixel 4XL, Samsung S9, S10, others

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 at the TextInputLayout entry point and reproduce the XML case with app:hintEnabled="false" and an error. Verify the layout in the Layout Inspector and IDE preview; done means the hidden hint no longer reserves top space while the error and TextInputEditText remain correctly positioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.