Fix sidenav drop indicator position (#5304)

regression after #5263
This commit is contained in:
windingwind 2025-05-30 06:59:08 +02:00 • committed by GitHub
parent 769b4c8c34
commit cdcac8a6e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -608,6 +608,11 @@
// Keep in sync with _itemPaneSidenav.scss
let btnSize = 28;
let btnGap = 6;
let btnToggleSize = 42;
let isStacked = this.classList.contains("stacked");
let baseSize = isStacked ? 0 : btnToggleSize;
// Before the center of the button, insert before it; otherwise, insert after it.
let index = 0;
if (offset < btnSize / 2) {
@ -619,7 +624,7 @@
}
return {
index,
position: index === 0 ? 0 : index * (btnSize + btnGap) + btnGap / 2
position: (index === 0 ? 0 : index * (btnSize + btnGap) + btnGap / 2) + baseSize
};
};