Skip to content

Commit 521ecf8

Browse files
committed
Fix BreadCrumbContainer width logic in Breadcrumb class
Updated the logic for setting BreadCrumbContainer.WidthRequest to ensure it does not exceed BreadCrumbsScrollView.Width. Now, if containerWidth is greater than BreadCrumbsScrollView.Width, BreadCrumbContainer.WidthRequest is set to containerWidth; otherwise, it is set to BreadCrumbsScrollView.Width.
1 parent b7cad29 commit 521ecf8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Scr/Breadcrumb.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,14 @@ await Task.Run(async () =>
303303
}
304304
containerWidth -= lastBreadcrumbWidth;
305305

306-
if(containerWidth > BreadCrumbContainer.WidthRequest)
306+
if(containerWidth > BreadCrumbsScrollView.Width)
307307
{
308308
MainThread.BeginInvokeOnMainThread(() => BreadCrumbContainer.WidthRequest = containerWidth);
309309
}
310+
else
311+
{
312+
MainThread.BeginInvokeOnMainThread(() => BreadCrumbContainer.WidthRequest = BreadCrumbsScrollView.Width);
313+
}
310314
MainThread.BeginInvokeOnMainThread(async () => await BreadCrumbsScrollView.ScrollToAsync((View?)BreadCrumbContainer.Children.LastOrDefault(), ScrollToPosition.MakeVisible, false));
311315
});
312316
}

0 commit comments

Comments
 (0)