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: crud2中列宽调整不生效和开启列宽会始终出现横向滚动条的问题 #8738

Closed
Closed
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 packages/amis-ui/scss/components/_table2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,11 @@
}
}
}
> thead > tr > .#{$ns}Table-cell-last {
.#{$ns}Table-thead-resizable {
right: 0;
}
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/amis-ui/src/components/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,9 @@ export class Table extends React.PureComponent<TableProps, TableState> {

const column = this.tdColumns[index];
this.resizeIndex = index;
this.resizeWidth = this.state.colWidths[column.name].width;
this.resizeWidth =
this.state.colWidths[column.name].width ??
this.state.colWidths[column.name].realWidth;
this.resizeTarget!.classList.add('is-resizing');

document.addEventListener('mousemove', this.onResizeMouseMove);
Expand Down