From 2282441869e7b821dce4684f377ee1822eedac22 Mon Sep 17 00:00:00 2001 From: Salih Date: Thu, 25 Jan 2024 15:42:50 +0300 Subject: [PATCH 1/2] Fix: Selects on docs shrinks to unusable sizes on mobile --- .../Pages/Documents/Project/Index.cshtml | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index 85d402c11d..d285ae5338 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -332,28 +332,45 @@ - @foreach (var parameter in Model.DocumentPreferences.Parameters) - { -
-
- @(parameter.DisplayName) - + @foreach (var value in parameter.Values.OrderBy(p => p.Value)) { - + @if (value.Key == (Model.UserPreferences.ContainsKey(parameter.Name) ? Model.UserPreferences[parameter.Name] : null)) + { + + } + else + { + + } } - } - + +
- + } }
From 893b038efc72edb3fb0b7ae351d3180bb0c311da Mon Sep 17 00:00:00 2001 From: Salih Date: Thu, 25 Jan 2024 15:57:53 +0300 Subject: [PATCH 2/2] Update Index.cshtml --- .../src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index d285ae5338..83f4c7a775 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -337,12 +337,13 @@ var count = Model.DocumentPreferences.Parameters.Count; var rowCount = count / maxCellCount + (count % maxCellCount > 0 ? 1 : 0); var cellSize = 12 / (count > maxCellCount ? maxCellCount : count); + var latestCellSize = 12 / count - (rowCount - 1) * maxCellCount; string BuildParameterDivClass(int index) { var row = index / maxCellCount; var isLastRow = row == rowCount - 1; - var currentCellSize = isLastRow ? 12 / (count % maxCellCount) : cellSize; + var currentCellSize = isLastRow ? latestCellSize : cellSize; return $"col-12 col-lg-{currentCellSize} mb-lg-{(isLastRow ? "0" : "2")} {(index == count - 1 ? "" : "mb-2")}"; }