Skip to content

Commit 1a8f8b0

Browse files
authored
fix(ui5-segmentedbutton): size adjustments (#1225)
- correct cosy and compact height - listen on resize of the parent, not on the body
1 parent 9dab18b commit 1a8f8b0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/main/src/SegmentedButton.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ class SegmentedButton extends UI5Element {
9696
this.absoluteWidthSet = false; // set to true whenever we set absolute width to the component
9797
this.percentageWidthSet = false; // set to true whenever we set 100% width to the component
9898
this.hasPreviouslyFocusedItem = false;
99-
}
10099

101-
onEnterDOM() {
102100
this._handleResizeBound = this._handleResize.bind(this);
101+
}
103102

104-
ResizeHandler.register(document.body, this._handleResizeBound);
103+
onEnterDOM() {
104+
ResizeHandler.register(this.parentNode, this._handleResizeBound);
105105
}
106106

107107
onExitDOM() {
108-
ResizeHandler.deregister(document.body, this._handleResizeBound);
108+
ResizeHandler.deregister(this.parentNode, this._handleResizeBound);
109109
}
110110

111111
onBeforeRendering() {

packages/main/src/themes/SegmentedButton.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
::slotted(ui5-togglebutton) {
1010
border-radius: 0;
11-
height: 2.75rem;
11+
height: var(--_ui5_button_base_height);
1212
min-width: 2.5rem;
1313
white-space: nowrap;
1414
overflow: hidden;

0 commit comments

Comments
 (0)