Skip to content

Commit

Permalink
Merge pull request #11051 from kangzhanlei/fit-tablerow
Browse files Browse the repository at this point in the history
fit: 解决表格行编辑的时候的弹窗,无法获取返回值的问题
  • Loading branch information
allenve authored Nov 22, 2024
2 parents 0adb1cf + 7e8554a commit c6d3fe1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/amis/src/renderers/Table/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class TableRow extends React.PureComponent<
@autobind
handleAction(e: React.UIEvent<any>, action: Action, ctx: any) {
const {onAction, item} = this.props;
onAction && onAction(e, action, ctx || item.locals);
return onAction && onAction(e, action, ctx || item.locals);
}

@autobind
Expand Down
4 changes: 3 additions & 1 deletion packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export type TableColumnWithType = SchemaObject & TableColumnObject;
export type TableColumn = TableColumnWithType | TableColumnObject;

type AutoFillHeightObject = Record<'height' | 'maxHeight', number>;

/**
* Table 表格渲染器。
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/table
Expand Down Expand Up @@ -1025,7 +1026,7 @@ export default class Table extends React.Component<TableProps, object> {
const {onAction} = this.props;

// todo
onAction(e, action, ctx);
return onAction(e, action, ctx);
}

async handleCheck(item: IRow, value?: boolean, shift?: boolean) {
Expand Down Expand Up @@ -1375,6 +1376,7 @@ export default class Table extends React.Component<TableProps, object> {
}

tableUnWatchResize?: () => void;

tableRef(ref: HTMLTableElement) {
this.table = ref;
isAlive(this.props.store) && this.props.store.setTable(ref);
Expand Down

0 comments on commit c6d3fe1

Please sign in to comment.