Giter Club home page Giter Club logo

Comments (5)

thermogl avatar thermogl commented on August 26, 2024

Weirdly, in using my own picker, I haven't seen this behaviour - but I don't call resignFirstResponder on the field manually.

I've changed the addToken method to make the field become first responder before adding the token. Seems to work.

from titokenfield.

jpstuehler avatar jpstuehler commented on August 26, 2024

Sorry, for the confusion. Your last fix didn't really help with this problem.

The solution was to change the call order in the picker delegates. First the picker view needs to be dismissed and then the addToken method should be used. This way everything works fine. If you try to add a token before dismissing the picker it will screw up the results.

from titokenfield.

thermogl avatar thermogl commented on August 26, 2024

I'm confused a little; You're saying it's nothing to do with the TITokenField? You just needed to change some stuff in your own code?

from titokenfield.

jpstuehler avatar jpstuehler commented on August 26, 2024

It has something to do with TITokenfield and the issue is related to the responder chain.

I'm using the built in people picker and this way it won't work:

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
      shouldContinueAfterSelectingPerson:(ABRecordRef)person {

    [tokenFieldView.tokenField addToken:@"SomeName"];
    [self dismissModalViewControllerAnimated:YES];  
    return NO;
}

The reason for this is that the addToken method won't work correctly as long as another UI element is first responder, because all tokenNames need to be drawn before another one can be added. Changing the order in this example and first dismissing the modal view and then using addToken works just fine.

from titokenfield.

thermogl avatar thermogl commented on August 26, 2024

Oh I see - well for now, obviously just swap the lines so it works.

I'll keep looking into it.

from titokenfield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.