From 7951adcb416c1f5a8346eb11b94de1fe4423fb37 Mon Sep 17 00:00:00 2001 From: Vladislav Tasev Date: Wed, 29 Jul 2020 14:54:26 +0300 Subject: [PATCH] fix(ui5-segmentedbutton): buttons no longer shrink on click (#2028) --- packages/main/src/SegmentedButton.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/main/src/SegmentedButton.js b/packages/main/src/SegmentedButton.js index 1f23519d274d..b35dff6f385a 100644 --- a/packages/main/src/SegmentedButton.js +++ b/packages/main/src/SegmentedButton.js @@ -111,7 +111,7 @@ class SegmentedButton extends UI5Element { this.percentageWidthSet = false; // set to true whenever we set 100% width to the component this.hasPreviouslyFocusedItem = false; - this._handleResizeBound = this._handleResize.bind(this); + this._handleResizeBound = this._doLayout.bind(this); this.i18nBundle = getI18nBundle("@ui5/webcomponents"); } @@ -128,7 +128,7 @@ class SegmentedButton extends UI5Element { } async onAfterRendering() { - await this.measureButtonsWidth(); + await this._doLayout(); } prepareToMeasureButtons() { @@ -211,7 +211,7 @@ class SegmentedButton extends UI5Element { } } - async _handleResize() { + async _doLayout() { const buttonsHaveWidth = this.widths && this.widths.some(button => button.offsetWidth > 2); // 2 are the pixel's added for rounding & IE if (!buttonsHaveWidth) { await this.measureButtonsWidth();