From 182f4c369aeef3b86e69a72def2e778b4ec755f0 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Fri, 28 Sep 2012 12:57:13 +0200 Subject: [PATCH] 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 --- AppKit/CPTextField.j | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 07d52f7dd..93b77e769 100644 --- a/AppKit/CPTextField.j +++ b/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];