aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content_scripts/scroller.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee
index f3c632b3..8eb50d77 100644
--- a/content_scripts/scroller.coffee
+++ b/content_scripts/scroller.coffee
@@ -38,7 +38,9 @@ ensureScrollChange = (direction, changeFn) ->
element = activatedElement
loop
oldScrollValue = element[axisName]
- changeFn(element, axisName)
+ overflow = window.getComputedStyle(element, null).getPropertyValue("overflow-#{direction}")
+ # Elements with `overflow: hidden` don't natively have scrolling, so we shouldn't scroll them.
+ changeFn(element, axisName) unless overflow == "hidden"
break unless (element[axisName] == oldScrollValue && element != document.body)
lastElement = element
# we may have an orphaned element. if so, just scroll the body element.