Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete token on iOS 8 when using a custom keyboard #38

Open
frobichaud opened this issue Nov 21, 2014 · 6 comments
Open

Can't delete token on iOS 8 when using a custom keyboard #38

frobichaud opened this issue Nov 21, 2014 · 6 comments

Comments

@frobichaud
Copy link

I have SwiftKey installed and the Delete key doesn't delete tokens. It does work if I switch the keyboard back to the native one.

@ayanonagon
Copy link
Contributor

Ah, it seems like keyboardInputShouldDelete does not get called for custom keyboards (http://stackoverflow.com/questions/25371254/how-to-detect-delete-key-on-an-uitextfield-in-ios-8). I’ll take a look at this, thanks!

@suhailwy
Copy link

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;
    }

@frobichaud
Copy link
Author

@suhailwy, can you create a pull request?

@bhanubirani
Copy link

@frobichaud Seems like this has not completely fixed the issue. In swiftkey when you press backspace it just select, the next consecutive backspace doens't delete the token.

@Zwaaan
Copy link

Zwaaan commented Feb 23, 2016

Same for me, still doesn't fix it for Swiftkey

michalrentka pushed a commit to michalrentka/VENTokenField that referenced this issue Feb 25, 2016
michalrentka pushed a commit to michalrentka/VENTokenField that referenced this issue Feb 25, 2016
@michalrentka
Copy link

@Zwaaan & @bhanubirani check out my pull request, that should fix it for Swiftkey and other custom keyboards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants