Commit aa73295
authored
Safari's compositor resets scrollTop to 0 when momentum-scrolling ends
inside a container whose child is a web-component shadow DOM (the
@pierre/diffs `<diffs-container>`). The reset bypasses all JavaScript
APIs — neither scrollTo nor the scrollTop setter fires.
Add a WebKit-only scroll event listener that detects the bogus reset
(scrollTop jumping from >200 to 0 in a single event, which cannot
happen during normal scrolling) and synchronously restores the last
known good position before the browser paints the wrong frame.
Closes #540
For provenance purposes, this commit was AI assisted.
1 parent 8ee7c6b commit aa73295
1 file changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
326 | 366 | | |
327 | 367 | | |
328 | 368 | | |
| |||
0 commit comments