Skip to content

Commit

Permalink
fix(ui5-avatar-group): adapt width calculations in composite layouts (#…
Browse files Browse the repository at this point in the history
…5357)

The calculations of the main container width have been adjusted to take into account sibling nodes.

Fixes #5333
  • Loading branch information
stbodurov authored Jun 14, 2022
1 parent 1aac3c5 commit d176800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/main/src/AvatarGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class AvatarGroup extends UI5Element {
item = button;
}

return this.effectiveDir === "rtl" ? this._getWidthToItem(item) : item.offsetLeft;
return this.effectiveDir === "rtl" ? this._getWidthToItem(item) : item.offsetLeft - this.offsetLeft;
}

return button.offsetWidth;
Expand Down Expand Up @@ -526,7 +526,7 @@ class AvatarGroup extends UI5Element {
}

// in LTR the width is equal to item.offsetLeft
return item.offsetLeft;
return item.offsetLeft - this.offsetLeft;
}

/**
Expand Down

0 comments on commit d176800

Please sign in to comment.