question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TextInputLayout] Hiding already hidden error causes helper text to be hidden

See original GitHub issue

Description: Calling TextInputLayout.setError(null) without checking TextInputLayout.getError() for null will cause the helper text to show only for a brief amount of time (< 1s) before disappearing again.

Expected behavior: Calling TextInputLayout.setError(null) consecutively is expected to only hide the error only and not the helper text as well.

Source code:

final TextInputLayout inputLayout = findViewById(R.id.input_email);
inputLayout.setHelperText("Email");
inputLayout.setError("Email required");
inputLayout.setError(null);
inputLayout.setError(null);

Android API version: 28

Material Library version: 1.1.0-alpha09

Device: Asus Zenfone Max Pro (M1)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
azolcommented, Oct 17, 2019

I have the same issue. Seems lake a bug to me. As for me – should be reopened. I expect that currently displayed helper text is not affected by setting error to null in any way. Simply do nothing Don’t even animate. It’s not ok that the result of setting error to null is hiding currently displayed helper text. Material Library version: 1.1.0-beta01

1reaction
victorharrycommented, Oct 24, 2019

Having this problem too, don’t know how to solve it… Didn’t get this part “textInputLayoutPassword.helperText = resources.getText(R.string.login_error_lower_length_password)”

I had the same problem and I found as solution this one:

  • don’t set the error to null but set helperText directly I did so in kotlin:
  • textInputLayoutPassword.error = null and i solved with:
  • textInputLayoutPassword.helperText = resources.getText(R.string.login_error_lower_length_password)
Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Hide text input layout's error after editing the field's text
I'm trying to hide error on a ...
Read more >
TextInputLayout not removing error view [37049145]
When calling TextInputLayout#setError(CharSequence) with a null CharSequence the ... We don't want to force a visual re-layout due to an error being hidden....
Read more >
Android TextInputLayout Example | DigitalOcean
To display the error text, we'll have to call the method setError(String) on an instance of TextInputLayout in our MainActivity. java class as ......
Read more >
A toolbar is already hidden on this side of your screen. You ...
I get this error in Windows 10 every time I turn off or on the TV, I it have connected to my laptop...
Read more >
TextInputLayout Styling - Medium
xml should be used to customize labels, helpers and errors in TextInputLayout. The parent of the text appearance style should be TextAppearance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found