Search code examples
androidandroid-layoutandroid-textinputedittext

Android - TextInputEditText text being spelled inverted


I have a TextInputEditText in my fragment and whenever I type a text, it is being spelled inverted. SO if I try and type "Leonardo", it will be spelled "odranoeL". The cursor is being positioned on the start of the last letter inputted and the next letter is put on the left side of the last one.

This is my XML:

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/match_edit_education_input_layout"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="16dp"
                android:layout_marginTop="16dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/match_edit_profession_input_layout">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/match_edit_education_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="top"
                    android:hint="@string/education_mandatory"
                    android:inputType="textCapSentences" />

            </com.google.android.material.textfield.TextInputLayout>

I try to isolate it on another project, but the I can't replicate the problem.


Solution

  • I suspect there is some TextWatcher that resets the cursor position on every change.