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
This commit is contained in:
Martin Carlberg
2012-09-28 12:57:13 +02:00
parent a337bc28f9
commit 182f4c369a
+3
View File
@@ -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];