From 2ba83d30f67a61f9bfc4945ec4fb09be401223fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 26 Apr 2019 17:17:03 +0200 Subject: [PATCH] fix: Scroll state had top and left properties flipped (#1469) fix: Scroll state had top and left properties flipped --- lib/core/utils/scroll-state.js | 2 +- test/core/utils/scroll-state.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/utils/scroll-state.js b/lib/core/utils/scroll-state.js index cb3151dff9..db24ca5c12 100644 --- a/lib/core/utils/scroll-state.js +++ b/lib/core/utils/scroll-state.js @@ -20,7 +20,7 @@ function getScroll(elm) { */ function setScroll(elm, top, left) { if (elm === window) { - return elm.scroll(top, left); + return elm.scroll(left, top); } else { elm.scrollTop = top; elm.scrollLeft = left; diff --git a/test/core/utils/scroll-state.js b/test/core/utils/scroll-state.js index 1cb97eebe8..a8cf6ed1d4 100644 --- a/test/core/utils/scroll-state.js +++ b/test/core/utils/scroll-state.js @@ -155,7 +155,7 @@ describe('axe.utils.setScrollState', function() { it('calls scroll() for the window element', function() { var called; var winScroll = window.scroll; - window.scroll = function(top, left) { + window.scroll = function(left, top) { called = { top: top, left: left }; }; setScrollState([{ elm: window, top: 10, left: 20 }]);