On Aug 28, 2009, at 12:02 PM, Ben Lachman wrote:
My app, SousChef, uses the AppKit autocomplete functionality in a bunch of places. Currently if a user types "So" they are presented with a list of completions and the first actual completion ("Soup") is used inline and selected so that this completed part is used if the user tabs to the next item but isn't if the user keeps typing (e.g. "up" is selected, "So" is not). However in recently we've noticed that if you are typing through an autocomplete and hit space, the current completion is accepted and the space is appended to it. This is unwanted behavior. However in Safari's location bar, which has the functionality I want, if you hit space, the space is appended to the partial word instead of the full completion. Anyone have an idea of how to get this behavior of just accepting on enter/tab (cancel on escape already works)? Currently I'm only implementing - textView:completionsForPartialWordRange:indexOfSelectedItem:. I thought to override keyDown: but the problem is that the field editor is eating keystrokes.
I guess your field editor could override complete: and not call super if the user has just typed a space.
_______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
