Merge pull request #12249 from atom/ns-as-fix-spacebar-regression

Fix regression where spacebar scrolled elements containing editors
This commit is contained in:
Nathan Sobo 2016-07-27 17:29:02 -06:00 committed by GitHub
commit c00af22c88

View File

@ -365,7 +365,12 @@ class TextEditorComponent
onTextInput: (event) =>
event.stopPropagation()
event.preventDefault()
# WARNING: If we call preventDefault on the input of a space character,
# then the browser interprets the spacebar keypress as a page-down command,
# causing spaces to scroll elements containing editors. This is impossible
# to test.
event.preventDefault() if event.data isnt ' '
return unless @isInputEnabled()