Skip to content

Commit

Permalink
fix(table): 修复 onDragStart 事件不触发问题 (#2858)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Jun 6, 2024
1 parent 33f44eb commit a8d3a1f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-bobcats-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

fix(table): 修复 onDragStart 事件不触发问题
5 changes: 5 additions & 0 deletions .changeset/itchy-suns-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/table": patch
---

fix: 修复 onDragStart 事件不触发问题
7 changes: 1 addition & 6 deletions packages/ui/form/stories/label-placement.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ export const LabelPlacement = () => {
<FormItem required={true} label="编码" field="productCode" valueType="string">
<Input placeholder="请输入" />
</FormItem>
<FormItem
required={true}
label="产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称产品名称"
field="productName"
valueType="string"
>
<FormItem required={true} label="产品名称" field="productName" valueType="string">
<Input placeholder="请输入" />
</FormItem>
<FormItem label="" field="productName" valueType="string">
Expand Down
1 change: 1 addition & 0 deletions packages/ui/table/src/use-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ export const useTable = ({
draggable,
highlightColumns: [] as any,
dragRowRef,
onDragStart,
onDrop,
groupedColumns,
// 子树展开
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/table/stories/draggable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export const Draggable = () => {
<div className="table-draggable__wrap" style={{ minWidth: 660 }}>
<Table
draggable
onDragStart={(e) => console.log('onDragStart', e)}
onDrop={(e) => {
console.log('onDrop', e)
return true
}}
columns={[
{
title: '商品名',
Expand Down

0 comments on commit a8d3a1f

Please sign in to comment.