@samitouri / QOS-React-2 / commits / 7325189890

Fix scrollLeft/scrollTop warning in latest Chrome

Chrome gives the warnings ``` body.scrollLeft is deprecated in strict mode. Please use 'documentElement.scrollLeft' if in strict mode and 'body.scrollLeft' only if in quirks mode. body.scrollTop is deprecated in strict mode. Please use 'documentElement.scrollTop' if in strict mode and 'body.scrollTop' only if in quirks mode. ``` the first time getUnboundedScrollPosition is invoked. This fixes it. (All modern browsers support `pageYOffset`; IE 8 doesn't but works properly with `document.documentElement.scrollTop` except in quirks mode which React doesn't support.)

Ben Alpert committed Dec 7, 2013 at 15:57 UTC 7325189890d3f2ff5f4ff8f5acb594cbd7ed6fe3
1 file changed +2 -2
src/vendor/core/dom/getUnboundedScrollPosition.js
+2 -2
@@ -32,8 +32,8 @@
32 function getUnboundedScrollPosition(scrollable) {
33 if (scrollable === window) {
34 return {
35 - x: document.documentElement.scrollLeft || document.body.scrollLeft,
36 - y: document.documentElement.scrollTop || document.body.scrollTop
35 + x: window.pageXOffset || document.documentElement.scrollLeft,
36 + y: window.pageYOffset || document.documentElement.scrollTop
37 };
38 }
39 return {