diff --git a/.changeset/cold-bobcats-knock.md b/.changeset/cold-bobcats-knock.md new file mode 100644 index 000000000..1eeeccb39 --- /dev/null +++ b/.changeset/cold-bobcats-knock.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(table): 修复 onDragStart 事件不触发问题 diff --git a/.changeset/itchy-suns-sleep.md b/.changeset/itchy-suns-sleep.md new file mode 100644 index 000000000..717aa1c8a --- /dev/null +++ b/.changeset/itchy-suns-sleep.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/table": patch +--- + +fix: 修复 onDragStart 事件不触发问题 diff --git a/packages/ui/form/stories/label-placement.stories.tsx b/packages/ui/form/stories/label-placement.stories.tsx index fa316976e..bc8de0df1 100644 --- a/packages/ui/form/stories/label-placement.stories.tsx +++ b/packages/ui/form/stories/label-placement.stories.tsx @@ -88,12 +88,7 @@ export const LabelPlacement = () => { - + diff --git a/packages/ui/table/src/use-table.ts b/packages/ui/table/src/use-table.ts index d74a08343..24cbd7f6a 100644 --- a/packages/ui/table/src/use-table.ts +++ b/packages/ui/table/src/use-table.ts @@ -656,6 +656,7 @@ export const useTable = ({ draggable, highlightColumns: [] as any, dragRowRef, + onDragStart, onDrop, groupedColumns, // 子树展开 diff --git a/packages/ui/table/stories/draggable.stories.tsx b/packages/ui/table/stories/draggable.stories.tsx index 86fa98844..ad9be1b68 100644 --- a/packages/ui/table/stories/draggable.stories.tsx +++ b/packages/ui/table/stories/draggable.stories.tsx @@ -11,6 +11,11 @@ export const Draggable = () => {
console.log('onDragStart', e)} + onDrop={(e) => { + console.log('onDrop', e) + return true + }} columns={[ { title: '商品名',