Skip to content

Commit

Permalink
fix: no-op if onScroll applied to incorrect element
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerWhitehead7 committed Oct 29, 2024
1 parent 2911fcd commit 0a6d281
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/virtual/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { For, createSignal } from "solid-js";
import type { Accessor, JSX } from "solid-js";
import type { DOMElement } from "solid-js/jsx-runtime";
import { access } from "@solid-primitives/utils";
import type { MaybeAccessor } from "@solid-primitives/utils";

Expand Down Expand Up @@ -58,7 +57,7 @@ export function createVirtualList<T extends readonly any[]>({
}),
e => {
// @ts-expect-error
setOffset(e.target?.scrollTop);
if (e.target?.scrollTop !== undefined) setOffset(e.target.scrollTop);
},
];
}
Expand Down

0 comments on commit 0a6d281

Please sign in to comment.