Fixed: firstResponder is lost when adding a firstResponder view to the same window

Previously, when adding a view (which is the firstResponder of the window) to the same window, the firstResponder was set to nil.
Now it keeps the same firstResponder.
This commit is contained in:
Alexandre Wilhelm
2014-09-29 19:19:17 -07:00
parent 38370c7f2e
commit 921fcbdcd0
+1 -1
View File
@@ -751,7 +751,7 @@ var CPViewFlags = { },
[[self window] _dirtyKeyViewLoop];
// Clear out first responder if we're the first responder and leaving.
if ([_window firstResponder] === self)
if ([_window firstResponder] === self && _window != aWindow)
[_window makeFirstResponder:nil];
// Notify the view and its subviews