Warn when scroll view gets accidentally scrolled and fix it

I want this code to go away once we track down the causes of any
unwanted autoscrolling by the browser
This commit is contained in:
Nathan Sobo 2014-05-22 19:53:14 -06:00
parent 9c066d93fa
commit ce9b34c9eb

View File

@ -45,6 +45,11 @@ EditorScrollViewComponent = React.createClass
@getDOMNode().addEventListener 'overflowchanged', @onOverflowChanged
window.addEventListener('resize', @onWindowResize)
node.addEventListener 'scroll', ->
console.warn "EditorScrollView scroll position changed, and it shouldn't have. If you can reproduce this, please report it."
node.scrollTop = 0
node.scrollLeft = 0
@measureHeightAndWidth()
componentDidUnmount: ->