Fixed: after tabbing to a token field it'd immediately lose first responder status.

Without this fix, the tab key press would be propagated to the browser, which would blur the focused input element, even when that input element was the one the new first responder intended to use.
This commit is contained in:
Alexander Ljungberg committed 2012-11-18 22:32:41 +00:00
1 parent 788ee6cd90
commit fd3ad76db3
1 file changed
+20 -2
+20 -2
View File
@@ -1673,11 +1673,29 @@ CPTexturedBackgroundWindowMask
[self selectPreviousKeyView:self];
else
[self selectNextKeyView:self];
#if PLATFORM(DOM)
// Make sure the browser doesn't try to do its own tab handling.
// This is important or the browser might blur the shared text field or token field input field,
// even that we just moved it to a new first responder.
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]
#endif
return;
}
else if ([anEvent charactersIgnoringModifiers] === CPBackTabCharacter)
return [self selectPreviousKeyView:self];
{
var didTabBack = [self selectPreviousKeyView:self];
if (didTabBack)
{
#if PLATFORM(DOM)
// Make sure the browser doesn't try to do its own tab handling.
// This is important or the browser might blur the shared text field or token field input field,
// even that we just moved it to a new first responder.
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]
#endif
}
return didTabBack;
}
[[self firstResponder] keyDown:anEvent];