refactor(ui): rename measureElementRef to measureElement in sortable components

This commit is contained in:
oomeow
2026-09-16 19:17:47 +08:00
parent 676cf2821b
commit 2c2a189a4f
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ interface SortableItemProps {
group?: string
disabled?: boolean
// 用于给 tanstack virtual 列表测量当前拖动元素尺寸
measureElementRef?: (element: HTMLDivElement | null) => void
measureElement?: (element: HTMLDivElement | null) => void
dataIndex?: number
style?: CSSProperties
children: ReactNode | ((props: SortableItemRenderProps) => ReactNode)
@@ -26,7 +26,7 @@ export const SortableItem = (props: SortableItemProps) => {
index,
group,
disabled,
measureElementRef,
measureElement,
dataIndex,
children,
style,
@@ -42,9 +42,9 @@ export const SortableItem = (props: SortableItemProps) => {
(element: HTMLDivElement | null) => {
handleRef(element?.querySelector('[data-sortable-handle]') ?? null)
ref(element)
measureElementRef?.(element)
measureElement?.(element)
},
[handleRef, ref, measureElementRef],
[handleRef, ref, measureElement],
)
const mergedStyle: CSSProperties = {
@@ -164,7 +164,7 @@ export function GroupedVirtualList<T>(props: GroupedVirtualListProps<T>) {
id={entry.id}
index={vi.index}
disabled={entry.category === 'original'}
measureElementRef={virtualizer.measureElement}
measureElement={virtualizer.measureElement}
dataIndex={vi.index}
style={{
position: 'absolute',