Skip to content

Commit

Permalink
Merge pull request #92 from Mercantec-GHC/clear-search-filters
Browse files Browse the repository at this point in the history
Clear sort labels
  • Loading branch information
ArianYN authored May 28, 2024
2 parents c1a1b51 + d33e534 commit a03cf00
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion BlazorApp/Components/Pages/Products.razor
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

<div class="sort-reset">
<label style="color: white;">Clear filter</label>
<button @onclick="ProductReset">Clear filter</button>
<button @onclick="ClearSortSelections">Clear filter</button>
</div>

</div>
Expand Down Expand Up @@ -245,6 +245,12 @@ void CloseSortModal()
sortModal = false;
}

void ClearSortSelections()
{
selectedBrandOption = "";
selectedTypeOption = "";
}

void ApplySort()
{
productsToShow.Clear();
Expand Down Expand Up @@ -285,6 +291,8 @@ void ApplySort()
}
}



// Apply Sort Order (ascending or descending)
productsToShow = sortAscending ? productsToShow.OrderBy(p => p.Price).ToList() : productsToShow.OrderByDescending(p => p.Price).ToList();

Expand Down

0 comments on commit a03cf00

Please sign in to comment.