Prevent scrolling when a space is pressed in editor

Closes atom/settings-view#25
This commit is contained in:
Kevin Sawicki
2014-01-29 13:28:01 -08:00
parent 1b396b5ce7
commit 4a54565f59

View File

@@ -428,8 +428,14 @@ class EditorView extends View
lastInput = e.originalEvent.data
@editor.insertText(lastInput)
@hiddenInput.val(lastInput)
false
# Return true if the last input was a space
# This prevents parent elements from scrolling
if lastInput is ' '
true
else
@hiddenInput.val(lastInput)
false
bringHiddenInputIntoView: ->
@hiddenInput.css(top: @scrollTop(), left: @scrollLeft())