[TextInputLayout] OnFocusChangeListener is only notified on first gained focus
See original GitHub issueDescription:
Settings a OnFocusChangeListener
on the TextInputEditText
inside the TextInputLayout
notifies the listener only the very first time the focus is gained.
Expected behavior: The listener should always fire when focus is gained and lost.
Source code:
textInputEditText.setOnFocusChangeListener { _, hasFocus ->
println("only fires on first focus gained")
}
Android API version: 29
Material Library version: 1.2.0-alpha04
Device: Emulator
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (3 by maintainers)
Top Results From Across the Web
How can I detect focused EditText in android? - Stack Overflow
You can use View.OnFocusChangeListener to detect if any view (edittext) gained or lost focus. for (EditText view : editList){ view.
Read more >How To Use On Focus Change to Format Edit Text on Android ...
Hello everyone, this post I will be talking about how to use Android Studio View.OnFocusChangeListener() to make sure users are interacting ...
Read more >Cannot add OnFocusChangeListener to EditText Wrapped ...
The handler of TextInputLayout responds only to message with what value ... so that the programmer can listen to the focus of the...
Read more >View.OnFocusChangeListener | Android Developers
Public methods. abstract void, onFocusChange(View v, boolean hasFocus). Called when the focus state of a view has changed.
Read more >TextInputLayout - Android SDK | Android Developers
Layout which wraps an EditText (or descendant) to show a floating label when the hint is hidden due to the user inputting text....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the exact same issue, as described by kazougagh. When setting endIconMode programatically its never called again.
Hi @leticiarossi , This issue occurs when you try to set the endIconMode programmatically and not using the xml attributes. Like this:
`