(node: Element)
| 1 | export const isScrollable = (node: Element) => { |
| 2 | if (!(node instanceof HTMLElement || node instanceof SVGElement)) { |
| 3 | return false |
| 4 | } |
| 5 | const style = getComputedStyle(node) |
| 6 | return ['overflow', 'overflow-x', 'overflow-y'].some((propertyName) => { |
| 7 | const value = style.getPropertyValue(propertyName) |
| 8 | return value === 'auto' || value === 'scroll' |
| 9 | }) |
| 10 | } |
| 11 | |
| 12 | const getScrollParent = (node: Element | null) => { |
| 13 | if (!node) { |
no outgoing calls
no test coverage detected
searching dependent graphs…