Browse files

Make sure the text field is visible before focus so the browser

will not scroll without the NSScrollView knowing about it
Issue #1675 and maybe a little of issue #1301
This fix will not work without pull
request #1678 - Fixed scrollRectToVisible in CPView
  • Loading branch information...
1 parent a337bc2 commit 182f4c369aeef3b86e69a72def2e778b4ec755f0 @mrcarlberg committed Sep 28, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 AppKit/CPTextField.j
View
3 AppKit/CPTextField.j
@@ -513,6 +513,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
*/
- (void)_becomeFirstKeyResponder
{
+ // Make sure the text field is visible so the browser will not scroll without the NSScrollView knowing about it.
+ [self scrollRectToVisible:[self bounds]];
+
[self setThemeState:CPThemeStateEditing];
[self _updatePlaceholderState];

0 comments on commit 182f4c3

Please sign in to comment.