mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Merge pull request #2319 from Dogild/TokenFieldkeyEquivalent
Fixed: CPApplication dispatch the event when having the auto complete menu of a CPTokenField opened
This commit is contained in:
@@ -1033,6 +1033,21 @@ CPTokenFieldDeleteButtonType = 1;
|
||||
[[[self window] platformWindow] _propagateCurrentDOMEvent:YES];
|
||||
}
|
||||
|
||||
- (BOOL)performKeyEquivalent:(CPEvent)anEvent
|
||||
{
|
||||
var characters = [anEvent characters];
|
||||
|
||||
// Here we handle the event when getting a CPNewlineCharacter or CPCarriageReturnCharacter when the menu is open
|
||||
// We don't want that the application dispatches the event to the other controls
|
||||
if ([self hasThemeState:CPThemeStateAutocompleting] && (characters === CPNewlineCharacter || characters === CPCarriageReturnCharacter))
|
||||
{
|
||||
[self keyDown:anEvent];
|
||||
return YES;
|
||||
}
|
||||
|
||||
return [super performKeyEquivalent:anEvent];
|
||||
}
|
||||
|
||||
- (void)textDidChange:(CPNotification)aNotification
|
||||
{
|
||||
if ([aNotification object] !== self)
|
||||
|
||||
Reference in New Issue
Block a user