(dir)
| 141 | // when the active screen's own content overflows, let it scroll natively |
| 142 | // until it hits the edge — only then do we snap to the next/prev screen |
| 143 | const canScrollWithin = (dir) => { |
| 144 | const screen = node.firstElementChild?.children[pageIndexRef.current]; |
| 145 | if (!screen) return false; |
| 146 | const {scrollTop, scrollHeight, clientHeight} = screen; |
| 147 | if (scrollHeight - clientHeight <= 2) return false; |
| 148 | return dir > 0 ? scrollTop + clientHeight < scrollHeight - 2 : scrollTop > 2; |
| 149 | }; |
| 150 | const onWheel = (e) => { |
| 151 | if (Math.abs(e.deltaY) < 8) return; |
| 152 | if (canScrollWithin(e.deltaY)) return; |
no outgoing calls
no test coverage detected