material-components / material-components/material-components-android
[TextInputLayout] OnFocusChangeListener is only notified on first gained focus
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the focus behavior with TextInputLayout and its TextInputEditText using the Kotlin listener example in the issue. Trace the focus-change handling in the Material Components Android implementation and check existing tests for TextInputLayout or TextInputEditText. Done means the listener fires on every focus gain and loss, including repeated focus cycles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100