diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index 154a5d33e..d69d8b7fd 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -455,12 +455,8 @@ export default { const style = modelToStyle.getStyle(); if (!onlyHeight) { - const padding = 10; - const frameOffset = canvas.getCanvasView().getFrameOffset(); - const width = - rect.w < frameOffset.width - padding - ? rect.w - : frameOffset.width - padding; + const bodyw = canvas.getBody().offsetWidth; + const width = rect.w < bodyw ? rect.w : bodyw; style[keyWidth] = autoWidth ? 'auto' : `${width}${unitWidth}`; }