mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Prevent scrolling when a space is pressed in editor
Closes atom/settings-view#25
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user