Skip to content

Commit

Permalink
fixed styling
Browse files Browse the repository at this point in the history
  • Loading branch information
tsanislavgatev committed Apr 14, 2020
1 parent ce873bd commit 53bfd5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/main/src/SegmentedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,16 @@ class SegmentedButton extends UI5Element {

_handleResize() {
const parentWidth = this.parentNode.offsetWidth;
const items = Array.from(this.shadowRoot.querySelector(".ui5-segmentedbutton-root").children);

if (!this.style.width || this.percentageWidthSet) {
this.style.width = `${Math.max(...this.widths) * this.buttons.length}px`;
this.absoluteWidthSet = true;
}

this.buttons.forEach(button => {
button.style.width = "100%";
});
items.forEach( item => {
item.style.width = "100%";
})

if (parentWidth <= this.offsetWidth && this.absoluteWidthSet) {
this.style.width = "100%";
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/themes/SegmentedButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

::slotted(ui5-togglebutton:nth-child(odd)) {
Expand Down

0 comments on commit 53bfd5e

Please sign in to comment.