Merge pull request #4752 from qinhaoyan/fix/table-resize

styles:修复table组件列宽拖拽时,光标位置不准问题
This commit is contained in:
RUNZE LU 2022-06-30 20:59:17 +08:00 committed by GitHub
commit b2c1303dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1844,6 +1844,7 @@ popOver 的其它配置请参考 [popover](./popover)
| affixRow | `Array` | | 底部总结行 | | affixRow | `Array` | | 底部总结行 |
| itemBadge | [`BadgeSchema`](./badge) | | 行角标配置 | | itemBadge | [`BadgeSchema`](./badge) | | 行角标配置 |
| autoFillHeight | `boolean` | | 内容区域自适应高度 | | autoFillHeight | `boolean` | | 内容区域自适应高度 |
| resizable | `boolean` | `true` | 列宽度是否支持调整 |
## 列配置属性表 ## 列配置属性表

View File

@ -1503,7 +1503,8 @@ export default class Table extends React.Component<TableProps, object> {
@autobind @autobind
handleColResizeMouseMove(e: MouseEvent) { handleColResizeMouseMove(e: MouseEvent) {
const moveX = e.clientX - this.lineStartX; const moveX = e.clientX - this.lineStartX;
this.resizeLine.style.left = this.resizeLineLeft + moveX + 'px'; // 光标right为-4px列宽改变时会自动跟随不需要单独处理位置
// this.resizeLine.style.left = this.resizeLineLeft + moveX + 'px';
this.targetTh.style.width = this.targetThWidth + moveX + 'px'; this.targetTh.style.width = this.targetThWidth + moveX + 'px';
} }