Skip to content

Commit

Permalink
Merge pull request #2859 from XiaoMi/hotfix/table/2858
Browse files Browse the repository at this point in the history
fix(table): 修复 onDragStart 事件不触发问题 (#2858)
  • Loading branch information
solarjoker authored Jun 12, 2024
2 parents 7e2138d + a8d3a1f commit 4f135ae
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 4f135ae

Please sign in to comment.