3 ms·
My own personal bugbear with individually scrolling elements is when the user hits the min/max scrollHeight of an element and the event immediately propagates b
by ry_ry 10y ago
My own personal bugbear with individually scrolling elements is when the user hits the min/max scrollHeight of an element and the event immediately propagates back up to the document element, scrolling the whole page. This probably isn't actually what they were trying to do if it's not full-width body content, and making that scrollable seems like a pretty terrible idea in the first place since default scroll behaviour is otherwise OK.
I don't think artificially constraining body is the answer though.
Neither is capturing the mousewheel event and checking Element.scrollTop and/or e.deltaY tbh, and I've been asked to do that in living memory for scrollable modals. Trying to eliminate that jank on that was fun.
- jstimpfle 10y agoI think constraining body (to 100% width and height, that's what you mean right?) is fine, however it's not solving the general problem of scrollwheel propagation. There should be a clean way to disable scrollwheel propagation, but a very quick web search indicates there may not be.
- ry_ry 10y agoYeah, sorry, if it's 100% of the viewport, kinda like an old fashioned frameset, you won't get the scroll propagation thing - if it's 100% of html,body you still hit it of course. But yeah, mousewheel scroll propagation is a pain, and you can't even cancel a regular scroll event even after shimming it for the wheel. Scrolling works well at a basic level, but could definitely do with some love.