Skip to content

Commit

Permalink
fix(components): [table-v2] fix scrolling fail (#16470)
Browse files Browse the repository at this point in the history
fix(components): [table-v2] Fix scrolling fail

closed 16266
  • Loading branch information
Tsong-LC committed Apr 26, 2024
1 parent 901d6eb commit f3215b6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/components/table-v2/src/table-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,12 @@ const useTableGrid = (props: TableV2GridProps) => {
const header$ = unref(headerRef)
const body$ = unref(bodyRef)

if (!header$ || !body$) return

if (isObject(leftOrOptions)) {
header$.scrollToLeft(leftOrOptions.scrollLeft)
body$.scrollTo(leftOrOptions)
header$?.scrollToLeft(leftOrOptions.scrollLeft)
body$?.scrollTo(leftOrOptions)
} else {
header$.scrollToLeft(leftOrOptions)
body$.scrollTo({
header$?.scrollToLeft(leftOrOptions)
body$?.scrollTo({
scrollLeft: leftOrOptions,
scrollTop: top,
})
Expand Down

0 comments on commit f3215b6

Please sign in to comment.