()
| 292 | } |
| 293 | |
| 294 | const onScroll = () => { |
| 295 | setIndices((prev) => { |
| 296 | const { scrollLeft, scrollTop } = containerElement; |
| 297 | |
| 298 | const scrollOffset = adjustScrollOffsetForRtl({ |
| 299 | containerElement, |
| 300 | direction, |
| 301 | isRtl, |
| 302 | scrollOffset: direction === "vertical" ? scrollTop : scrollLeft |
| 303 | }); |
| 304 | |
| 305 | const next = getStartStopIndicesUtil({ |
| 306 | cachedBounds, |
| 307 | containerScrollOffset: scrollOffset, |
| 308 | containerSize, |
| 309 | itemCount, |
| 310 | overscanCount |
| 311 | }); |
| 312 | |
| 313 | if (shallowCompare(next, prev)) { |
| 314 | return prev; |
| 315 | } |
| 316 | |
| 317 | return next; |
| 318 | }); |
| 319 | }; |
| 320 | |
| 321 | containerElement.addEventListener("scroll", onScroll); |
| 322 |
nothing calls this directly
no test coverage detected