[TextInputEditText] Does not detect click event
See original GitHub issueDescription: The com.google.android.material.textfield.TextInputEditText
does not detect the click event when it is used to write a debug message in Logcat (or any other use of setOnClickListener
)
Expected behavior: When click in a TextInputEditText, show debug message in Logcat
Source code: The layout:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="label">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="false"
android:inputType="number" />
</com.google.android.material.textfield.TextInputLayout>
The activity:
val value = findViewById<TextInputEditText>(R.id.value)
value.setOnClickListener {
Log.d("LOG", "Clicked")
}
Android API version: API 28
Material Library version: 1.2.0-alpha02
Device: Xiaomi Mi A2
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
onClick event is not triggered on TextInputEditText android
the problem that onClick is not triggered on the first touch, it is only called when I press for the second time.
Read more >Onclick Event Is Not Triggered On Textinputedittext ... - ADocLib
Android EditText OnClickListener not working onClick event is not triggering The onClick doesn't trigger the first time it is pressed as it should.If...
Read more >EditText - Android Developers
android:soundEffectsEnabled, Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching.
Read more >How to Handle IME Options on Action Button Click in Android?
This is because when we invoked the keyboard by pressing on the EditText, we saw the Done button. This is when no IME...
Read more >Android TextInputLayout Example | DigitalOcean
Furthermore, using an EditText instead would shoot us a warning : EditText added is not a TextInputEditText. Please switch to using that ...
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
The onclicklistener is only triggered if the text field has focus (so it triggers first OnFocusChangeListener then if you click again it will trigger the click listener). If you wants to do something when the edit text is first clicked you can use a on focus changed listener instead
how to bring pop up list to select item to the textInput field