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