Skip to content

Empty string is registered as token #9

@OliverDimitrov

Description

@OliverDimitrov

Hi!
I'm trying to use your component and I'm pretty much satisfied from it, but I've hit a rock when I'm pressing just space. It keeps adding tokens, which are pretty much in every case invalid.

I've tried using something like this in didEnterText delegate method:
var tokens = tagsTextField.texts
tokens.removeLast()
tagsTextField.resetTokens()
for token in tokens {
tagsTextField.textField.text = token
tagsTextField.completeCurrentInputText()
}
but this redraws all tags and I don't like that jump all the time.

Can you either remove the empty string as valid token or provide us a way to check the text before adding as a token.
Or probably best would be to add an array of invalid strings.

Using the develop branch (Swift 3.0 version) with Cocoapods
pod 'ICInputAccessory/TokenField', :git => 'https://github.com/polydice/ICInputAccessory.git' , :branch => 'develop'

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions