aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-10 17:08:47 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-11 12:02:21 +0200
commit57606ff108c1c541f3e152a31bbbfdc0261b2dc6 (patch)
tree148147d9eedbf34d43d69357d313776519861553
parent2076e3bd0143ffc4f88c180ce3fa3b9ac41b3f85 (diff)
downloadsonarqube-57606ff108c1c541f3e152a31bbbfdc0261b2dc6.tar.gz
sonarqube-57606ff108c1c541f3e152a31bbbfdc0261b2dc6.zip
SONAR-9555 Page is not scrolled to selected issue when using IE11
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Component.tsx4
-rw-r--r--server/sonar-web/src/main/js/helpers/scrolling.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/Component.tsx b/server/sonar-web/src/main/js/apps/code/components/Component.tsx
index 8547e6eec19..8412774fc27 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Component.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/Component.tsx
@@ -63,9 +63,9 @@ export default class Component extends React.PureComponent<Props> {
const position = this.node.getBoundingClientRect();
const { top, bottom } = position;
if (bottom > window.innerHeight - BOTTOM_OFFSET) {
- window.scrollTo(0, bottom - window.innerHeight + window.scrollY + BOTTOM_OFFSET);
+ window.scrollTo(0, bottom - window.innerHeight + window.pageYOffset + BOTTOM_OFFSET);
} else if (top < TOP_OFFSET) {
- window.scrollTo(0, top + window.scrollY - TOP_OFFSET);
+ window.scrollTo(0, top + window.pageYOffset - TOP_OFFSET);
}
}
diff --git a/server/sonar-web/src/main/js/helpers/scrolling.ts b/server/sonar-web/src/main/js/helpers/scrolling.ts
index a36c6ef0789..701665223b4 100644
--- a/server/sonar-web/src/main/js/helpers/scrolling.ts
+++ b/server/sonar-web/src/main/js/helpers/scrolling.ts
@@ -28,7 +28,7 @@ function isWindow(element: HTMLElement | Window): element is Window {
}
function getScrollPosition(element: HTMLElement | Window): number {
- return isWindow(element) ? window.scrollY : element.scrollTop;
+ return isWindow(element) ? window.pageYOffset : element.scrollTop;
}
function scrollElement(element: HTMLElement | Window, position: number): void {