Merge pull request #1107 from atom/ks-editor-scroll

Fix editor occasionally going blank
This commit is contained in:
Kevin Sawicki
2013-11-11 12:48:08 -08:00
2 changed files with 11 additions and 0 deletions

View File

@@ -74,6 +74,16 @@ describe "Editor", ->
expect(editor.hiddenInput).toMatchSelector ':focus'
expect($(editor[0]).scrollTop()).toBe 0
expect($(editor.scrollView[0]).scrollTop()).toBe 0
editor.moveCursorToBottom()
editor.hiddenInput.blur()
editor.scrollTop(0)
editor.focus()
expect(editor.hiddenInput).toMatchSelector ':focus'
expect($(editor[0]).scrollTop()).toBe 0
expect($(editor.scrollView[0]).scrollTop()).toBe 0
describe "when the hidden input is focused / unfocused", ->
it "assigns the isFocused flag on the editor and also adds/removes the .focused css class", ->

View File

@@ -644,6 +644,7 @@ class Editor extends View
false
@hiddenInput.on 'focus', =>
@bringHiddenInputIntoView()
@isFocused = true
@addClass 'is-focused'