Open chiahsien opened 10 years ago
The tokens get removed when the field loses focus, and re-adds them when the fields gets focus.
I also ran into this. The problem is that addToken adds the token both to the model and the view. It's already in the model (_tokens) so just needs to be added as a subview. To fix it, I factored out an addTokenFromView from addToken, and called that from didBeginEditing(). I can submit this as a pull request if there's interest.
I'm trying to prevent user from adding duplicated token, and trying to limit maximum token counts.
So I try to do some checking like this:
I'll prompt user that he is trying to add duplicated token.
But I found that this method gets called while
tokenField
begins editing and ends editing, which makes the prompt shows up iftokenField
isn't empty.I'm curious why
addToken
gets called whentokenField
begins/ends editing. Any idea?