From e22b6f304e3e7d76ee0b58d0c92f89b19d3ca36a Mon Sep 17 00:00:00 2001 From: Loretta Date: Mon, 23 Mar 2026 05:32:15 +0100 Subject: [PATCH] Add scroll-to-item support to MgCardView component - Introduced `Height`, `ScrollToItem`, and `ItemKeySelector` parameters to MgCardView for scroll targeting and internal scroll area. - Cards now have stable DOM ids for precise JS-based scrolling. - Added mgCardView.js with smooth scroll logic; included script in app. - Updated CSS for scrollable card area. - Updated MeasuringOut.razor to use new scroll features and fixed time format. --- FruitBankHybrid.Shared/Pages/MeasuringOut.razor | 9 ++++++--- FruitBankHybrid.Web/Components/App.razor | 1 + FruitBankHybrid/wwwroot/index.html | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/FruitBankHybrid.Shared/Pages/MeasuringOut.razor b/FruitBankHybrid.Shared/Pages/MeasuringOut.razor index fffed34e..74d9231a 100644 --- a/FruitBankHybrid.Shared/Pages/MeasuringOut.razor +++ b/FruitBankHybrid.Shared/Pages/MeasuringOut.razor @@ -58,8 +58,11 @@
+ ShowFilterPanel="true" + OnCardClick="NavigateToMeasuringTab" + ScrollToItem="@SelectedOrder" + ItemKeySelector="o => o.Id" + Height="calc(100vh - 220px)"> @GetOrderStatusText(context.MeasuringStatus)
- @context.DateOfReceiptOrCreated.ToString("H:mm") — @context.Customer.Company + @context.DateOfReceiptOrCreated.ToString("HH:mm") — @context.Customer.Company
@foreach (var item in context.OrderItemDtos) { diff --git a/FruitBankHybrid.Web/Components/App.razor b/FruitBankHybrid.Web/Components/App.razor index 354fe3a0..65f5e74c 100644 --- a/FruitBankHybrid.Web/Components/App.razor +++ b/FruitBankHybrid.Web/Components/App.razor @@ -26,6 +26,7 @@ + - - + + +