Skip to content

Commit

Permalink
fix(ui5-segmentedbutton): buttons no longer shrink on click (#2028)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladitasev committed Jul 29, 2020
1 parent 03d439b commit 7951adc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/main/src/SegmentedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand All @@ -128,7 +128,7 @@ class SegmentedButton extends UI5Element {
}

async onAfterRendering() {
await this.measureButtonsWidth();
await this._doLayout();
}

prepareToMeasureButtons() {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7951adc

Please sign in to comment.