Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(table): 修复 onDragStart 事件不触发问题 (#2858) #2859

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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