fix(stage): 这有overflow为auto或scroll才在选中的时候设置为hidden

This commit is contained in:
roymondchen 2022-03-29 12:57:58 +08:00 committed by jia000
parent c60e226f35
commit 8619af91db

View File

@ -65,7 +65,10 @@ export default class StageDragResize extends EventEmitter {
*/
public async select(el: HTMLElement, event?: MouseEvent): Promise<void> {
this.target = el;
this.target.style.overflow = 'hidden';
// 如果有滚动条会导致resize时获取到widthheight不准确
if (/(auto|scroll)/.test(this.target.style.overflow)) {
this.target.style.overflow = 'hidden';
}
this.mode = getMode(el);
this.destroyDragEl();
this.destroyGhostEl();