Skip to content

Commit 7951adc

Browse files
authored
fix(ui5-segmentedbutton): buttons no longer shrink on click (#2028)
1 parent 03d439b commit 7951adc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/main/src/SegmentedButton.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class SegmentedButton extends UI5Element {
111111
this.percentageWidthSet = false; // set to true whenever we set 100% width to the component
112112
this.hasPreviouslyFocusedItem = false;
113113

114-
this._handleResizeBound = this._handleResize.bind(this);
114+
this._handleResizeBound = this._doLayout.bind(this);
115115
this.i18nBundle = getI18nBundle("@ui5/webcomponents");
116116
}
117117

@@ -128,7 +128,7 @@ class SegmentedButton extends UI5Element {
128128
}
129129

130130
async onAfterRendering() {
131-
await this.measureButtonsWidth();
131+
await this._doLayout();
132132
}
133133

134134
prepareToMeasureButtons() {
@@ -211,7 +211,7 @@ class SegmentedButton extends UI5Element {
211211
}
212212
}
213213

214-
async _handleResize() {
214+
async _doLayout() {
215215
const buttonsHaveWidth = this.widths && this.widths.some(button => button.offsetWidth > 2); // 2 are the pixel's added for rounding & IE
216216
if (!buttonsHaveWidth) {
217217
await this.measureButtonsWidth();

0 commit comments

Comments
 (0)