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)
I had the same problem and I found as solution this one:
@AlessandroAgneti I haven't tried this yet, I will give it a try soon. ;)
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
Let's hear what the team has for this as well.
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)
Having the same problem. Any update on the same?
I've the same problem.
This is definitely a bug, I will take a look at this ASAP
Currently looking into this! Seems like it's something happening in the IndicatorViewController logic
@leticiarossi I've pushed a WIP PR (I know you were working on it but I had some free time, sorry)
Most helpful comment
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