This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-site.git
The following commit(s) were added to refs/heads/main by this push:
new 0bf1809 Use safe API to get target element (#534)
0bf1809 is described below
commit 0bf180949a7954c0204c084699670859a26d4a5f
Author: Malthe Borch <[email protected]>
AuthorDate: Mon Jan 3 17:37:29 2022 +0100
Use safe API to get target element (#534)
As highlighted by @mik-laj in issue #361, the target string sometimes
contains a period (".")
character which makes `querySelector` match on a class which is wrong in
this case.
Regardless of whether it fixes the issue, this change is a good one.
---
landing-pages/src/js/progressTracking.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/landing-pages/src/js/progressTracking.js
b/landing-pages/src/js/progressTracking.js
index d730ed6..f86dc11 100644
--- a/landing-pages/src/js/progressTracking.js
+++ b/landing-pages/src/js/progressTracking.js
@@ -31,7 +31,7 @@ const runProgressTracking = () => {
const target = hash.substr(1);
let targetElement;
if (target) {
- targetElement = document.querySelector(`#${target}`);
+ targetElement = document.getElementById(target);
} else {
targetElement = document.body;
}