From a8d3a1f2687709b986fc54408cb6c69b9eb56318 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Thu, 6 Jun 2024 15:28:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(table):=20=E4=BF=AE=E5=A4=8D=20onDragStart?= =?UTF-8?q?=20=E4=BA=8B=E4=BB=B6=E4=B8=8D=E8=A7=A6=E5=8F=91=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#2858)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/cold-bobcats-knock.md | 5 +++++ .changeset/itchy-suns-sleep.md | 5 +++++ packages/ui/form/stories/label-placement.stories.tsx | 7 +------ packages/ui/table/src/use-table.ts | 1 + packages/ui/table/stories/draggable.stories.tsx | 5 +++++ 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 .changeset/cold-bobcats-knock.md create mode 100644 .changeset/itchy-suns-sleep.md 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: '商品名',