Comments (9)
Yea would really love to know if disabling autofocus is possible. I've tried most possible solutions from SO (that worked with EditText
s) but no game :/
from chips-input-layout.
Thanks for posting this issue!
This problem seems to be happening in the ChipsAdapter
whenever the edit text is readjusted to fit the width of the screen in the onGlobalLayout()
callback because it calls the requestFocus()
on the edit text itself.
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 app:autoFocusDisabled="false"
so that it knows you don't want it to request focus every time it's resized to fit the screen.
from chips-input-layout.
Any updates about this. because it's very weird and doesn't let users fill other inputs .
Any temporary fix will be helpful ..
Regards.
from chips-input-layout.
@bliveinhack this is my workaround for now. Try it and let me know if you find a better one.
Basically what I'm doing is execute some code with a small delay (50 milliseconds) after the activity has started which clears the focus from the tagview and requests focus on the view you want to receive focus first instead.
(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)
}
from chips-input-layout.
Thanks for workaround.
I'm ended up forking repository and make ChipEditText
public
so that i can clear focus on scrolling.
here is Jitpack https://jitpack.io/#bliveinhack/chips-input-layout/2.4.1
and Repo https://github.com/bliveinhack/chips-input-layout
Regards.
from chips-input-layout.
Did you try to set
android:focusable="false"
or
android:focusableInTouchMode="false"
It works fine for me.
from chips-input-layout.
It is not working for me
from chips-input-layout.
Any solution? I'm facing the same issue
from chips-input-layout.
in chipAdapter.java add
// Request focus
if (mDataSource.getSelectedChips().size() > 0) {
mEditText.requestFocus();
mEditText.setFocusableInTouchMode(true);
}
this code.
if chips are not empty then only focus otherwise don't focus.
from chips-input-layout.
Related Issues (20)
- AppCompat library issues and background color problem
- Avatar icon not hiding from the list of chips.
- Realm database as CustomDatasource
- Avatar shows up in chip filter list when avatar is disabled
- How to set chip selection limit ? HOT 1
- setDelimiter method not found HOT 4
- How to hide edittext
- setting chipbackground is not working
- Backspace Abnormal Behaviour HOT 1
- How to chnage the chip backgrounf color HOT 1
- Add a 'clearInputText' Method in ChipsInputLayout
- Delimiter not found HOT 2
- keyboard close after each chip is add HOT 1
- Unable to update runtime data
- Unable to change RecyclerView position
- Conver to Kotlin?
- Change input TextSize
- How to clear input text?
- Chip suggestion keep appearing after using setSelectedChipList
- SetText
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chips-input-layout.