Skip to content

Commit

Permalink
Fix #1276 by adding check for container size
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Jan 8, 2024
1 parent 6567ef5 commit 4dea2de
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/Core/Components/Overflow/FluentOverflow.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,21 @@ export function FluentOverflowResized(dotNetHelper, id, isHorizontal, querySelec

itemsTotalSize += element.overflowSize;

// Add an attribute 'overflow'
if (itemsTotalSize > containerMaxSize) {
if (!isOverflow) {
element.setAttribute("overflow", "");
overflowChanged = true;
// Only check for overflow if the container has a size
if (containerMaxSize > 0) {
if (itemsTotalSize > containerMaxSize) {
// Add an attribute 'overflow'
if (!isOverflow) {
element.setAttribute("overflow", "");
overflowChanged = true;
}
}
}

// Remove the attribute 'overflow'
else {
if (isOverflow) {
element.removeAttribute("overflow");
overflowChanged = true;
else {
// Remove the attribute 'overflow'
if (isOverflow) {
element.removeAttribute("overflow");
overflowChanged = true;
}
}
}

Expand Down

0 comments on commit 4dea2de

Please sign in to comment.