We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1d8fde commit 9138822Copy full SHA for 9138822
src/js/01-nav.js
@@ -146,8 +146,8 @@
146
}
147
148
function scrollItemToMidpoint (panel, item) {
149
- if (panel.scrollHeight === panel.clientHeight) return // not scrollable
150
var panelRect = panel.getBoundingClientRect()
+ if (panel.scrollHeight === Math.round(panelRect.height)) return // not scrollable
151
var linkRect = item.querySelector('.nav-link').getBoundingClientRect()
152
panel.scrollTop += Math.round(linkRect.top - panelRect.top - (panelRect.height - linkRect.height) * 0.5)
153
0 commit comments