mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
@@ -63,6 +63,15 @@ describe "Editor", ->
|
||||
expect(editor).not.toMatchSelector ':focus'
|
||||
expect(editor.hiddenInput).toMatchSelector ':focus'
|
||||
|
||||
it "does not scroll the editor (regression)", ->
|
||||
editor.attachToDom(heightInLines: 2)
|
||||
editor.selectAll()
|
||||
editor.hiddenInput.blur()
|
||||
editor.focus()
|
||||
|
||||
expect(editor.hiddenInput).toMatchSelector ':focus'
|
||||
expect($(editor[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", ->
|
||||
editor.attachToDom()
|
||||
|
||||
@@ -640,6 +640,7 @@ class Editor extends View
|
||||
@hiddenInput.on 'focusout', =>
|
||||
@isFocused = false
|
||||
@removeClass 'is-focused'
|
||||
@hiddenInput.offset(top: 0, left: 0)
|
||||
|
||||
@underlayer.on 'mousedown', (e) =>
|
||||
@renderedLines.trigger(e)
|
||||
|
||||
Reference in New Issue
Block a user