diff options
author | alpadev <2838324+alpadev@users.noreply.github.com> | 2021-07-28 17:23:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-28 17:23:32 +0300 |
commit | 047145e8086793e7c39747e70f5d74a8860c2e50 (patch) | |
tree | acd12f5076ead349866f6aae316d329c6ec98327 /js/src | |
parent | 24e14c36e86536853d5103a82064e514393cf480 (diff) |
Fix `Manipulator.offset()` (#33603)
* test: add more test cases for Manipulator.offset()
* fix: Manipulator.offset() is using obsolete properties to get scroll position
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: GeoSot <geo.sotis@gmail.com>
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/dom/manipulator.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/dom/manipulator.js b/js/src/dom/manipulator.js index 113817beed..a866993f0d 100644 --- a/js/src/dom/manipulator.js +++ b/js/src/dom/manipulator.js @@ -64,8 +64,8 @@ const Manipulator = { const rect = element.getBoundingClientRect() return { - top: rect.top + document.body.scrollTop, - left: rect.left + document.body.scrollLeft + top: rect.top + window.pageYOffset, + left: rect.left + window.pageXOffset } }, |