fix(gantt): preserve horizontal scroll when focusing a task bar

Focusing the task bar SVG `<g role="slider">` inside the
`overflow-x:auto` `.gantt-container` triggered Firefox's focus-induced
scroll-into-view, which jumped the scroll container back toward
`scrollLeft=0` (today). Pass `{ preventScroll: true }` to `focus()` so
selecting a bar keeps the current scroll position. Chromium scrolls
minimally on focus so it never manifested there.

Fixes #2728
This commit is contained in:
kolaente 2026-06-17 19:32:39 +02:00
parent c5d615843d
commit 3fc977c30e
1 changed files with 1 additions and 1 deletions

View File

@ -730,7 +730,7 @@ function focusTaskBar(rowId: string) {
setTimeout(() => { setTimeout(() => {
const taskBarElement = document.querySelector(`[data-row-id="${rowId}"] [role="slider"]`) as HTMLElement const taskBarElement = document.querySelector(`[data-row-id="${rowId}"] [role="slider"]`) as HTMLElement
if (taskBarElement) { if (taskBarElement) {
taskBarElement.focus() taskBarElement.focus({preventScroll: true})
} }
}, 0) }, 0)
} }