(el: DOMElement)
| 108 | for (const l of listenersRef.current) l(); |
| 109 | }; |
| 110 | function scrollMutated(el: DOMElement): void { |
| 111 | // Signal background intervals (IDE poll, LSP poll, GCS fetch, orphan |
| 112 | // check) to skip their next tick — they compete for the event loop and |
| 113 | // contributed to 1402ms max frame gaps during scroll drain. |
| 114 | markScrollActivity(); |
| 115 | markDirty(el); |
| 116 | markCommitStart(); |
| 117 | notify(); |
| 118 | if (renderQueuedRef.current) return; |
| 119 | renderQueuedRef.current = true; |
| 120 | queueMicrotask(() => { |
| 121 | renderQueuedRef.current = false; |
| 122 | scheduleRenderFrom(el); |
| 123 | }); |
| 124 | } |
| 125 | useImperativeHandle(ref, (): ScrollBoxHandle => ({ |
| 126 | scrollTo(y: number) { |
| 127 | const el = domRef.current; |
no test coverage detected