Skip to content

Commit

Permalink
fix: Scroll state had top and left properties flipped (#1469)
Browse files Browse the repository at this point in the history
fix: Scroll state had top and left properties flipped
  • Loading branch information
mislav authored and WilcoFiers committed Apr 26, 2019
1 parent d25cad8 commit 2ba83d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/core/utils/scroll-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/core/utils/scroll-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }]);
Expand Down

0 comments on commit 2ba83d3

Please sign in to comment.