Corrige scroll no deseado tras carga de página

Al integrar el menú lateral (sidebar) en el `div #mdbook` el efecto del
`scrollIntoView()` también afecta al contenido del documento desplazando
toda la página.
This commit is contained in:
Manuel Cillero 2022-07-26 06:29:49 +02:00
parent 8b75f72a44
commit 1094435a38

View file

@ -548,7 +548,7 @@ function playground_text(playground) {
var activeSection = document.getElementById("sidebar").querySelector(".active"); var activeSection = document.getElementById("sidebar").querySelector(".active");
if (activeSection) { if (activeSection) {
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
activeSection.scrollIntoView({ block: 'center' }); // activeSection.scrollIntoView({ block: 'center' });
} }
})(); })();