Skip to content

Commit b28c080

Browse files
authored
Merge pull request #402 from lobor/fixWeb
ref can be null in web
2 parents 5f1084c + 3fcae9c commit b28c080

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/hooks/use-scroll-handlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export function useScrollHandlers<T>(options?: DraggableNodeOptions) {
120120
timer.current = setTimeout(() => {
121121
const ref = resolveScrollRef(nodeRef);
122122
if (Platform.OS == 'web') {
123+
if (!ref) return;
123124
const rect = (ref as HTMLDivElement).getBoundingClientRect();
124125
(ref as HTMLDivElement).style.overflow = "auto";
125126
onMeasure(rect.x, rect.y, rect.width, rect.height, rect.left, rect.top);

0 commit comments

Comments
 (0)