venmo / VENTokenField

Easy-to-use token field that is used in the Venmo app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

With Third party keyboard the backspace is not working.

suhailwy opened this issue · comments

  • (void)textFieldDidEnterBackspace:(VENBackspaceTextField *)textField;
    is not getting called on "x" button for third party keyboard, so deleting any token is not possible at all in such case.

Thanks for the report, we’ll look into it as soon as we can.

well i have patched this issue, it happens if we are subclassing the text field.
You can modify the code in VENTOKENFIELD.m to

(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { BOOL isPressedBackspaceAfterSingleSpaceSymbol = [textField.text isEqualToString:@""] && range.location == 0 && range.length == 0 && string.length == 0; if (isPressedBackspaceAfterSingleSpaceSymbol) { if ([self respondsToSelector:@selector(textFieldDidEnterBackspace:)]) { [self textFieldDidEnterBackspace:self.inputTextField]; } }else { [self unhighlightAllTokens]; } return YES; }

We really wish this wasn't still broken!

Which keyboard are you using?
Is it accurately reporting delete key?

I can reproduce this issue as well, using Gboard on iOS 11 and 12, in my own app and in the Venmo app.

Raw text can be deleted, but tokens cannot. If the text field has a token in it and my cursor is just to the right of it, tapping the backspace key does nothing. If I tap the token to highlight it, tapping the backspace key still does nothing. If I switch to the system keyboard, tapping backspace twice will highlight and then delete the token, as expected.