File tree 1 file changed +14
-0
lines changed
ReactAndroid/src/main/java/com/facebook/react/views/textinput
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 19
19
import android .text .SpannableStringBuilder ;
20
20
import android .text .Spanned ;
21
21
import android .text .TextWatcher ;
22
+ import android .text .TextUtils ;
22
23
import android .text .method .KeyListener ;
23
24
import android .text .method .QwertyKeyListener ;
24
25
import android .text .style .AbsoluteSizeSpan ;
@@ -342,6 +343,11 @@ public int incrementAndGetEventCounter() {
342
343
343
344
// VisibleForTesting from {@link TextInputEventsTestCase}.
344
345
public void maybeSetText (ReactTextUpdate reactTextUpdate ) {
346
+ if ( isSecureText () &&
347
+ TextUtils .equals (getText (), reactTextUpdate .getText ())) {
348
+ return ;
349
+ }
350
+
345
351
// Only set the text if it is up to date.
346
352
mMostRecentEventCount = reactTextUpdate .getJsEventCounter ();
347
353
if (mMostRecentEventCount < mNativeEventCount ) {
@@ -439,6 +445,14 @@ private boolean isMultiline() {
439
445
return (getInputType () & InputType .TYPE_TEXT_FLAG_MULTI_LINE ) != 0 ;
440
446
}
441
447
448
+ private boolean isSecureText () {
449
+ return
450
+ (getInputType () &
451
+ (InputType .TYPE_NUMBER_VARIATION_PASSWORD |
452
+ InputType .TYPE_TEXT_VARIATION_PASSWORD ))
453
+ != 0 ;
454
+ }
455
+
442
456
private void onContentSizeChange () {
443
457
if (mContentSizeWatcher != null ) {
444
458
mContentSizeWatcher .onLayout ();
You can’t perform that action at this time.
0 commit comments