File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
vector/src/main/java/im/vector/app/features/form Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,18 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() {
130130 * especially when we want to use a single line, we set the InputType to InputType.TYPE_CLASS_TEXT
131131 * while the default for the EditText is InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
132132 */
133- private fun configureInputType (holder : Holder ) = holder.textInputEditText.setRawInputType(
134- inputType ? : when (singleLine) {
135- true -> InputType .TYPE_CLASS_TEXT
136- false -> InputType .TYPE_CLASS_TEXT or InputType .TYPE_TEXT_FLAG_MULTI_LINE
137- }
138- )
133+ private fun configureInputType (holder : Holder ) {
134+ val newInputType =
135+ inputType ? : when (singleLine) {
136+ true -> InputType .TYPE_CLASS_TEXT
137+ false -> InputType .TYPE_CLASS_TEXT or InputType .TYPE_TEXT_FLAG_MULTI_LINE
138+ }
139+
140+ // This is a must in order to avoid extreme lag in some devices, on fast typing
141+ if (holder.textInputEditText.inputType != newInputType) {
142+ holder.textInputEditText.inputType = newInputType
143+ }
144+ }
139145
140146 /* *
141147 * Configure the imeOptions of the EditText, when imeOptions are not defined by the developer
You can’t perform that action at this time.
0 commit comments