* Gets whether the vertical auto-scroll direction of a node. * @param clientRect Dimensions of the node. * @param pointerY Position of the user's pointer along the y axis.
(clientRect: DOMRect, pointerY: number)
| 808 | * @param pointerY Position of the user's pointer along the y axis. |
| 809 | */ |
| 810 | function getVerticalScrollDirection(clientRect: DOMRect, pointerY: number) { |
| 811 | const {top, bottom, height} = clientRect; |
| 812 | const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD; |
| 813 | |
| 814 | if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) { |
| 815 | return AutoScrollVerticalDirection.UP; |
| 816 | } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) { |
| 817 | return AutoScrollVerticalDirection.DOWN; |
| 818 | } |
| 819 | |
| 820 | return AutoScrollVerticalDirection.NONE; |
| 821 | } |
| 822 | |
| 823 | /** |
| 824 | * Gets whether the horizontal auto-scroll direction of a node. |
no outgoing calls
no test coverage detected