-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chip input always receives focus first #22
Comments
Yea would really love to know if disabling autofocus is possible. I've tried most possible solutions from SO (that worked with |
Thanks for posting this issue! This problem seems to be happening in the I could put a check in there like, 'if auto focus disabled then don't request focus', but that might effect the functionality of the auto sizing though. I'll attempt it then thoroughly test it, but you'd just need to set that in the view's XML layout like |
Any updates about this. because it's very weird and doesn't let users fill other inputs . Regards. |
@bliveinhack this is my workaround for now. Try it and let me know if you find a better one. (KOTLIN) override fun onStart() {
super.onStart()
// Work around to correct focus issue on tag field
Timer().schedule(50){
runOnUiThread {
// itemTags is ur tagview
itemTags.clearFocus()
// the view in your activity/fragment you want to give focus first
itemTitle.requestFocus()
// this is optional but helpful to show keyboard (doesn't work always and on all devices)
showKeyboardOnView(itemTitle)
}
}
}
private fun showKeyboardOnView(view: View) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(view,
InputMethodManager.SHOW_IMPLICIT)
} |
Thanks for workaround. I'm ended up forking repository and make Regards. |
Did you try to set android:focusable="false"
or
android:focusableInTouchMode="false" It works fine for me. |
It is not working for me |
Any solution? I'm facing the same issue |
in chipAdapter.java add this code. |
I have noticed that the chips input always receives the focus first in an activity. Is this the desired behaviour? I want to be able to disable this functionality so I can handle the focus order in my activity differently.
We could remove the focus from the chips element programmatically afterwards but then the user would notice the cursor switching from one element to another and this is bad user experience.
Has anyone noticed this? Any solution?
thanks
The text was updated successfully, but these errors were encountered: