fix(components): [table-v2] reset lastVisitedColumnIdx if width change (#19757)

fix(components): [table-v2] reset lastVisitedColumnIdx if width change
This commit is contained in:
Noblet Ouways
2025-02-06 12:29:43 +01:00
committed by GitHub
parent c4fc329237
commit 8b93dfd72a

View File

@@ -1,4 +1,12 @@
import { computed, defineComponent, inject, provide, ref, unref } from 'vue'
import {
computed,
defineComponent,
inject,
provide,
ref,
unref,
watch,
} from 'vue'
import {
DynamicSizeGrid,
FixedSizeGrid,
@@ -112,6 +120,14 @@ const useTableGrid = (props: TableV2GridProps) => {
unref(headerRef)?.$forceUpdate()
}
watch(
() => props.bodyWidth,
() => {
if (isNumber(props.estimatedRowHeight))
bodyRef.value?.resetAfter({ columnIndex: 0 }, false)
}
)
return {
bodyRef,
forceUpdate,