From c0f8c289e6dc73beb3e246fb07b73150537db76e Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Fri, 8 Mar 2019 13:39:17 +0100 Subject: [PATCH] Visual Console Client: minor fix Former-commit-id: 7e20bc7972f98e2cfe1a991d82cbf2dbc12c21de --- visual_console/src/items/Box.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/visual_console/src/items/Box.ts b/visual_console/src/items/Box.ts index 3dca242a88..86642c2f77 100644 --- a/visual_console/src/items/Box.ts +++ b/visual_console/src/items/Box.ts @@ -53,7 +53,10 @@ export default class Box extends Item { // Border. if (this.props.borderWidth > 0) { box.style.borderStyle = "solid"; - box.style.borderWidth = `${this.props.borderWidth}px`; + // Control the max width to prevent this item to expand beyond its parent. + const maxBorderWidth = Math.min(this.props.width, this.props.height) / 2; + const borderWidth = Math.min(this.props.borderWidth, maxBorderWidth); + box.style.borderWidth = `${borderWidth}px`; if (this.props.borderColor) { box.style.borderColor = this.props.borderColor;