Skip to content

Commit

Permalink
fix(deps): upgrade @tanstack/react-virtual to v3.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Dec 14, 2024
1 parent cf7afaf commit 3c4e600
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"@sanity/uuid": "^3.0.1",
"@sentry/react": "^8.33.0",
"@tanstack/react-table": "^8.16.0",
"@tanstack/react-virtual": "3.0.0-beta.54",
"@tanstack/react-virtual": "^3.11.1",
"@types/react-is": "^18.3.0",
"@types/shallow-equals": "^1.0.0",
"@types/speakingurl": "^13.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function ListArrayInput<Item extends ObjectItem>(props: ArrayOfObjectsInp
elementProps,
members,
onChange,
onInsert,
onItemMove,
onUpload,
focusPath,
Expand Down Expand Up @@ -113,7 +112,7 @@ export function ListArrayInput<Item extends ObjectItem>(props: ArrayOfObjectsInp

const scroll = instance.scrollElement

const handleScroll = () => {
const handleScroll = (evt?: Event) => {
const containerElementTop = containerElement.current?.getBoundingClientRect().top ?? 0
const parentElementTop = parentRef.current?.getBoundingClientRect().top ?? 0

Expand All @@ -122,7 +121,7 @@ export function ListArrayInput<Item extends ObjectItem>(props: ArrayOfObjectsInp
// We pass a component that we have more control over to avoid issues when wrapped in custom component
const itemOffset = Math.floor(parentElementTop - containerElementTop)

callback(scroll.scrollTop - itemOffset)
callback(scroll.scrollTop - itemOffset, Boolean(evt))
}

handleScroll()
Expand Down Expand Up @@ -225,7 +224,7 @@ export function ListArrayInput<Item extends ObjectItem>(props: ArrayOfObjectsInp
top: 0,
left: 0,
width: '100%',
transform: `translateY(${items[0].start}px)`,
transform: items.length > 0 ? `translateY(${items[0].start}px)` : undefined,
}}
>
{items.map((virtualRow) => {
Expand Down
22 changes: 12 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3c4e600

Please sign in to comment.