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:
parent
e2c437e81e
commit
efe0b2b626
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user