feat(ui): enable horizontal wheel scroll on nav menu

Converts vertical mouse wheel delta to horizontal scroll when hovering
the nav sidebar in tablet/mobile view. This allows intuitive scrolling
without needing Shift+wheel.

AI-assisted: Claude (fully tested locally)
This commit is contained in:
maax6 2026-01-28 02:16:17 +01:00
parent e2c437e81e
commit efe0b2b626

View File

@ -61,6 +61,14 @@ export function handleConnected(host: LifecycleHost) {
export function handleFirstUpdated(host: LifecycleHost) {
observeTopbar(host as unknown as Parameters<typeof observeTopbar>[0]);
// Horizontal wheel scroll for nav menu
document.querySelector('.nav')?.addEventListener('wheel', (evt) => {
const e = evt as WheelEvent;
if (e.deltaY !== 0) {
e.preventDefault();
(e.currentTarget as HTMLElement).scrollLeft += e.deltaY;
}
}, { passive: false });
}
export function handleDisconnected(host: LifecycleHost) {