mirror of
https://github.com/atom/atom.git
synced 2026-02-07 05:05:02 -05:00
WIP: Don't allow impossibly high scroll top values.
It fixes the move to bottom issues, but breaks some other tests. Not sure why yet...
This commit is contained in:
@@ -273,7 +273,9 @@ class Editor extends View
|
||||
scrollTop: (scrollTop, options) ->
|
||||
return @cachedScrollTop or 0 unless scrollTop?
|
||||
|
||||
scrollTop = Math.max(0, scrollTop)
|
||||
maxScrollTop = @scrollView.prop('scrollHeight') - @scrollView.height()
|
||||
scrollTop = Math.floor(Math.min(maxScrollTop, Math.max(0, scrollTop)))
|
||||
|
||||
return if scrollTop == @cachedScrollTop
|
||||
@cachedScrollTop = scrollTop
|
||||
|
||||
|
||||
Reference in New Issue
Block a user