(event: TouchEvent, zoom?: number)
| 24 | } |
| 25 | |
| 26 | export function isTouchOverScrollbar(event: TouchEvent, zoom?: number) { |
| 27 | const elem = event.target as HTMLElement; |
| 28 | |
| 29 | const clientRect = elem.getBoundingClientRect(); |
| 30 | |
| 31 | zoom = zoom ?? 1; |
| 32 | |
| 33 | const offsetX = (event.targetTouches[0].clientX - clientRect.x) / zoom; |
| 34 | const offsetY = (event.targetTouches[0].clientY - clientRect.y) / zoom; |
| 35 | |
| 36 | if (hasVertScrollbar(elem) && offsetX > elem.clientWidth) { |
| 37 | return true; |
| 38 | } |
| 39 | |
| 40 | if (hasHorizScrollbar(elem) && offsetY > elem.clientHeight) { |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | export function isMouseOverScrollbar(event: PointerEvent) { |
| 48 | const elem = event.target as HTMLElement; |
nothing calls this directly
no test coverage detected