From 17ddd4de9087a98c87bec28a6b773572b1c58b50 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 16 Sep 2026 16:26:16 +0200 Subject: menu: do not close on the panel's own scrolling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dismiss-on-scroll listener is on the capture phase, because `scroll` does not bubble — so it also heard the menu scrolling itself, and a long tracklist closed the moment it was wheeled. Filter on the event's origin. Co-Authored-By: Claude Opus 5 --- docs/playlists.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'docs/playlists.md') diff --git a/docs/playlists.md b/docs/playlists.md index 49b1585..c450815 100644 --- a/docs/playlists.md +++ b/docs/playlists.md @@ -808,10 +808,17 @@ The codebase has no context menu and no dropdown outside the account menu in button** — `icon.js` already has `dots` (`icon.js:54`). Both affordances, both platforms: the button is visible on hover on a fine pointer and always visible under `@media (pointer: coarse)`. -- closes on Escape, on an outside click, and **on scroll**. The last one is not - optional here: Music's toolbar is a sticky band and the grid scrolls beneath - it, so a menu that survives a scroll is a menu now anchored to a different - album than the one it was opened on. +- closes on Escape, on an outside click, and **on a scroll of the page**. The + last one is not optional here: Music's toolbar is a sticky band and the grid + scrolls beneath it, so a menu that survives a scroll is a menu now anchored to + a different album than the one it was opened on. **Never on a scroll of its + own panel** — the panel is `overflow-y: auto` and a tracklist is routinely + taller than the window, so the two must be told apart by where the event came + from. `scroll` does not bubble, so that listener is on the capture phase, + which is also what made it hear the panel's own scrolling: the menu closed the + instant it was wheeled or its scrollbar dragged, and no track below the fold + could be reached. Measured by `menu_scroll_probe.py`; `playlist_ui_probe.py` + cannot see it, because `.click()` scrolls nothing. - flips its anchor when it would open past the viewport edge, which on a phone is most of the time. - submenus **expand in place**, downward, at every width. This is the -- cgit v1.2.3