Status-react: All letters are removed when tapping erase button one time in password field after incorrect attempt [iOS only]

Created on 31 Aug 2017  路  5Comments  路  Source: status-im/status-react

Description

Type: Bug

Summary: When I am trying to edit the password (like correct 1 last symbol) in the password field after previous password was not accepted I am taping erase on the keyboard and all previously letters are removed

Expected behavior

I should be able to remove symbols one by one in password field after previous attempt was not accepted

Reproduction

  • Open Status
  • Create an account and remember password
  • Click switch accounts
  • Tap the account and enter incorrect password
  • Tap into the password field
  • Tap the erase button on the keyboard

Additional Information

bug ios low-priority

Most helpful comment

Seems like it's not a bug, but feature of iOS TextField https://stackoverflow.com/questions/7305538/uitextfield-with-secure-entry-always-getting-cleared-before-editing

Also, you get same behaviour on any iOS native app using TextField with secureTextEntry=true.

All 5 comments

Seems like it's not a bug, but feature of iOS TextField https://stackoverflow.com/questions/7305538/uitextfield-with-secure-entry-always-getting-cleared-before-editing

Also, you get same behaviour on any iOS native app using TextField with secureTextEntry=true.

@asemiankevich and @annadanchenko maybe this can be closed as per @dmitryn findings

This can be changed by overriding default behaviour of textField of iPhone, In for it!

(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string

Check using:
NSString *resultString = [textField.text stringByReplacingCharactersInRange:range withString:string];
BOOL isPressedBackspaceAfterSingleSpaceSymbol = [string isEqualToString:@""] && [resultString isEqualToString:@""] && range.location == 0 && range.length == 1;
if (isPressedBackspaceAfterSingleSpaceSymbol) {

//action of backwards delete

@asemiankevich can we close here?

Was this page helpful?
0 / 5 - 0 ratings