Skip to content

Commit

Permalink
[Android]textinput:Maintain cursor position when secureTextEntry togg…
Browse files Browse the repository at this point in the history
…les.
  • Loading branch information
jainkuniya committed Feb 7, 2018
1 parent d3db764 commit e4c87d4
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,10 @@ public void setMultiline(ReactEditText view, boolean multiline) {

@ReactProp(name = "secureTextEntry", defaultBoolean = false)
public void setSecureTextEntry(ReactEditText view, boolean password) {

This comment has been minimized.

Copy link
@uhoh2017

uhoh2017 Feb 7, 2018

wtf

updateStagedInputTypeFlag(
view,
password ? 0 :
InputType.TYPE_NUMBER_VARIATION_PASSWORD | InputType.TYPE_TEXT_VARIATION_PASSWORD,
password ? InputType.TYPE_TEXT_VARIATION_PASSWORD : 0);
int selectionStart = view.getSelectionStart();
view.setTransformationMethod(password ? new PasswordTransformationMethod() : null);
checkPasswordType(view);
view.setSelection(selectionStart);
}

@ReactProp(name = "autoCapitalize")
Expand Down

0 comments on commit e4c87d4

Please sign in to comment.