docs: scroll to center of the view port (#4515)

This commit is contained in:
Dmytro Kozlov 2023-06-26 07:27:16 +02:00 committed by Aliaksandr Valialkin
parent 4e0ca99da9
commit 316fe82dd6
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -17,7 +17,7 @@ window.addEventListener("load", function () {
element = document.querySelector(selector(href));
}
if (element) {
element.scrollIntoView({ behavior: "smooth" });
element.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" });
}
});