TITokenField icon indicating copy to clipboard operation
TITokenField copied to clipboard

TITokenField scroll to the last token

Open voicecho opened this issue 13 years ago • 5 comments

If there are many tokens in the token filed, it can be scrolled. The token field will scroll to the last token position whenever one of the token is touched. How could i forbid this? As the touched token could be scrolled out of the view, it is not that user friendly.

voicecho avatar Aug 21 '12 14:08 voicecho

Should be just a matter of adding a scrollRectToVisible call. I'll take a look.

thermogl avatar Aug 21 '12 15:08 thermogl

I don't think so. You did not call scrollRectToVisible at all. I think it is because you setText in both selectToken: and deselectSelectedToken: methods in TITokenFIeld.m. Actually I wanna use TITokenFIeld to get a receiver select view in the Sparrow.app. It is good but problem is that i can't control the scrolling of the token field view.

voicecho avatar Aug 22 '12 01:08 voicecho

Right, but hopefully adding a scrollRectToVisible call when selecting a token should override the behaviour of the editing rect being scrolled into view by the OS. I haven't had a chance to play with it yet, though.

thermogl avatar Aug 22 '12 01:08 thermogl

The cause of this is the call [self setText:kTextHidden] in selectToken and [self setText:kTextEmpty] in deselectToken. The good way is to not call those lines and then use self.selectedToken == nil as a flag elsewhere to check for conditions for shouldRemove, etc.

scottliu1234 avatar Sep 14 '12 19:09 scottliu1234

We need kTextEmpty to capture backspaces, but I'll look into replacing kTextHidden.

thermogl avatar Sep 15 '12 13:09 thermogl