Merge pull request #32794 from overleaf/mj-tab-scroll

[web] Allow scrolling with wheel in tab container

GitOrigin-RevId: af81825288387675bdac5d734041299126d3b44c
This commit is contained in:
Mathias Jakobsen
2026-04-15 08:05:26 +00:00
committed by Copybot
parent b345bf9485
commit d1ce54b513
2 changed files with 42 additions and 1 deletions
@@ -59,6 +59,14 @@ export const TabsContainer = () => {
setHovered(false)
}, [throttledOnDragOver])
const onWheel = useCallback((e: React.WheelEvent) => {
if (e.deltaY !== 0 && e.deltaX === 0) {
// if this is a purely vertical scroll, convert it to a horizontal scroll
// instead
e.currentTarget.scrollLeft += e.deltaY
}
}, [])
return (
<div className="editor-tabs-container">
<div
@@ -69,6 +77,7 @@ export const TabsContainer = () => {
onDragOver={onDragOver}
onDrop={onDrop}
onDragLeave={onDragLeave}
onWheel={onWheel}
tabIndex={-1}
>
{tabs.map(tab => (