mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-31 11:12:07 +08:00
refactor(list): remove feedbackClone from sortable item and list integration
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { Feedback } from '@dnd-kit/dom'
|
||||
import { useSortable } from '@dnd-kit/react/sortable'
|
||||
import { useTheme } from '@mui/material'
|
||||
import { type CSSProperties, type ReactNode, useCallback } from 'react'
|
||||
@@ -17,7 +16,6 @@ interface SortableItemProps {
|
||||
// 用于给 tanstack virtual 列表测量当前拖动元素尺寸
|
||||
measureElementRef?: (element: HTMLDivElement | null) => void
|
||||
dataIndex?: number
|
||||
feedbackClone?: boolean
|
||||
style?: CSSProperties
|
||||
children: ReactNode | ((props: SortableItemRenderProps) => ReactNode)
|
||||
}
|
||||
@@ -30,7 +28,6 @@ export const SortableItem = (props: SortableItemProps) => {
|
||||
disabled,
|
||||
measureElementRef,
|
||||
dataIndex,
|
||||
feedbackClone,
|
||||
children,
|
||||
style,
|
||||
} = props
|
||||
@@ -38,9 +35,6 @@ export const SortableItem = (props: SortableItemProps) => {
|
||||
id,
|
||||
index,
|
||||
group,
|
||||
...(feedbackClone && {
|
||||
plugins: [Feedback.configure({ feedback: 'clone' })],
|
||||
}),
|
||||
disabled,
|
||||
})
|
||||
const theme = useTheme()
|
||||
|
||||
@@ -164,7 +164,6 @@ export function GroupedVirtualList<T>(props: GroupedVirtualListProps<T>) {
|
||||
id={entry.id}
|
||||
index={vi.index}
|
||||
disabled={entry.category === 'original'}
|
||||
feedbackClone
|
||||
measureElementRef={virtualizer.measureElement}
|
||||
dataIndex={vi.index}
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user