Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsanislavgatev committed Apr 14, 2020
1 parent 53bfd5e commit 8d15091
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/main/src/SegmentedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const metadata = {
propertyName: "buttons",
type: HTMLElement,
individualSlots: true,
listenFor: {
include: ["pressed"],
},
},
},
events: /** @lends sap.ui.webcomponents.main.SegmentedButton.prototype */ {
Expand Down Expand Up @@ -176,16 +179,16 @@ class SegmentedButton extends UI5Element {

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

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

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

if (parentWidth <= this.offsetWidth && this.absoluteWidthSet) {
this.style.width = "100%";
Expand Down

0 comments on commit 8d15091

Please sign in to comment.