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:
parent
c5d615843d
commit
3fc977c30e
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue