Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.facebook.react.views.text.TextInlineImageSpan;
import com.facebook.react.views.view.ReactViewBackgroundManager;
import java.util.ArrayList;
import java.util.Arrays;

/**
* A wrapper around the EditText that lets us better control what happens when an EditText gets
Expand Down Expand Up @@ -393,9 +394,24 @@ public void setInputType(int type) {
// ScrollView, a prompt will be triggered but the system fail to locate it properly.
// Here is an example post discussing about this issue:
// https://github.com/facebook/react-native/issues/27204
String[] xiaomiManufacturers = new String[]{
"M2002J9G",
"M2002J9G",
"M2004J19C",
"M2007J20CG",
"Mi",
"MI",
"MIX",
"POCO",
"POCOPHONE",
"Redmi",
"Xiaomi"
};
boolean isXiaomi = Arrays.asList(xiaomiManufacturers).contains(Build.MANUFACTURER);

if (inputType == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
&& Build.VERSION.SDK_INT == Build.VERSION_CODES.Q
&& Build.MANUFACTURER.startsWith("Xiaomi")) {
&& isXiaomi) {
inputType = InputType.TYPE_CLASS_TEXT;
}

Expand Down