DevCloudFE / ng-devui

Angular UI Component Library based on DevUI Design
https://devui.design
MIT License
1.75k stars 210 forks source link

🐛 [Bug]: 表格列宽拖动代码可能存在问题 #352

Closed chester0424 closed 4 months ago

chester0424 commented 5 months ago

Version

1.7.1.0

Angular Version

17.3.0

Link to minimal reproduction

https://[github.com](https://github.com/DevCloudFE/ng-devui)/DevCloudFE/ng-devui/devui/data-table/table/head/th/th.component.ts

Step to reproduce

devui/data-table/table/head/th/th.component.ts 中 onMousedown和onMouseup成对方法, onMousedown 方法添加resize-overlay元素代码: this.renderer2.appendChild(this.element.firstElementChild, this.resizeOverlay); 而在 onMouseup方法中删除元素diamante: this.renderer2.removeChild(this.element, this.resizeOverlay);

导致运行时报错 ERROR DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

What is expected

No response

What is actually happening

No response

Any additional comments (optional)

修改成: this.renderer2.removeChild(this.element.firstElementChild, this.resizeOverlay); 就正常了

Simplelegant commented 4 months ago

感谢贡献 #353