Skip to content

Commit

Permalink
Fixed: token fields would sometimes unexpectedly steal first responde…
Browse files Browse the repository at this point in the history
…r status.

If an autocomplete choice was made followed by immediately focusing on another control, the token field would reclaim first responder status a moment later.
  • Loading branch information
aljungberg committed Aug 1, 2012
1 parent 31ab70d commit 90ae576
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions AppKit/_CPAutocompleteMenu.j
Expand Up @@ -65,7 +65,7 @@ var _CPAutocompleteMenuMaximumHeight = 307;
[scrollView setHasHorizontalScroller:NO];
[contentView addSubview:scrollView];

tableView = [[CPTableView alloc] initWithFrame:CPRectMakeZero()];
tableView = [[_CPNonFirstResponderTableView alloc] initWithFrame:CPRectMakeZero()];

var tableColumn = [CPTableColumn new];
[tableColumn setResizingMask:CPTableColumnAutoresizingMask];
Expand Down Expand Up @@ -251,14 +251,14 @@ var _CPAutocompleteMenuMaximumHeight = 307;
return [contentArray objectAtIndex:row];
}

- (void)tableViewSelectionDidChange:(CPNotification)notification
@end


@implementation _CPNonFirstResponderTableView : CPTableView

- (BOOL)acceptsFirstResponder
{
// FIXME
// make sure a mouse click in the tableview doesn't steal first responder state
window.setTimeout(function()
{
[[textField window] makeFirstResponder:textField];
}, 2.0);
return NO;
}

@end

0 comments on commit 90ae576

Please sign in to comment.