()
| 74 | if (!scrollbox) return |
| 75 | |
| 76 | const checkOverflow = () => { |
| 77 | const contentHeight = scrollbox.scrollHeight |
| 78 | const viewportHeight = scrollbox.viewport.height |
| 79 | const isOverflowing = contentHeight > viewportHeight |
| 80 | |
| 81 | if (hasOverflowRef.current !== isOverflowing) { |
| 82 | hasOverflowRef.current = isOverflowing |
| 83 | setHasOverflow(isOverflowing) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | checkOverflow() |
| 88 | scrollbox.verticalScrollBar.on('change', checkOverflow) |