fix(ui): keep a context menu open while its own list scrolls - #795
Conversation
The menu closed on every scroll it captured, the playlist list inside the Add to a playlist submenu included, so the list could not be scrolled at all. Only a scroll outside the menu closes it now, and the list no longer hands its scroll on to the page once it reaches the end.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. 9 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. 📝 WalkthroughWalkthroughLe menu contextuel reste ouvert lors d’un défilement interne. Les défilements extérieurs continuent de le fermer. La liste des playlists empêche la propagation du défilement en butée vers la page. ChangesMenu contextuel et liste des playlists
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Le défilement de la liste conserve le menu ouvert et son dépassement ne se propage pas à la page; les scrolls extérieurs continuent de le fermer. Aucun risque concret ne s’oppose à la fusion. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reported while adding tracks to a playlist: scrolling the playlist list in Add to a playlist closed the whole menu, so any playlist below the first few could not be reached.
Cause
ContextMenucloses on scroll so it never floats away from its anchor. It listens onwindowin the capture phase, which catches every scroll, including the one inside its own submenu list (max-h-64 overflow-y-auto).Change
ContextMenu: a scroll whose target sits inside[data-context-menu](the menu or its submenu) is ignored. Any other scroll still closes the menu as before. This is fixed in the shared component, so every menu benefits.TrackContextMenu: the playlist list getsoverscroll-contain. Without it, reaching the end of the list chains the wheel to the page, which scrolls and closes the menu.playlists.mdon why the grid's menu survives an unmount now says page scroll.typecheck,eslint,prettierand the local CodeRabbit review pass.Summary by CodeRabbit