Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

help: Fix exception with invalid fragment causing bogus extra scrollbars.

Tim Abbott42d601e214ff
diff --git a/static/js/portico/help.js b/static/js/portico/help.js
index 16024858ac0..c324dd042c1 100644
--- a/static/js/portico/help.js
+++ b/static/js/portico/help.js
@@ -56,7 +56,7 @@ function render_code_sections() {
function scrollToHash(simplebar) {
const hash = window.location.hash;
const scrollbar = simplebar.getScrollElement();
- if (hash !== '') {
+ if (hash !== '' && $(hash).length > 0) {
const position = $(hash).position().top - $(scrollbar.firstChild).position().top;
scrollbar.scrollTop = position;
} else {