From d03a9510a5ae00e74d166629d4670d7eaeb5f7bf Mon Sep 17 00:00:00 2001 From: Donkie Date: Sun, 13 Aug 2023 12:11:15 +0200 Subject: [PATCH] Client: Sort filament/vendor dropdowns --- client/src/pages/filaments/create.tsx | 5 +++++ client/src/pages/filaments/edit.tsx | 5 +++++ client/src/pages/spools/create.tsx | 1 + client/src/pages/spools/edit.tsx | 1 + 4 files changed, 12 insertions(+) diff --git a/client/src/pages/filaments/create.tsx b/client/src/pages/filaments/create.tsx index 65396c9..d058e13 100644 --- a/client/src/pages/filaments/create.tsx +++ b/client/src/pages/filaments/create.tsx @@ -59,6 +59,11 @@ export const FilamentCreate: React.FC { + return a?.label && b?.label + ? (a.label as string).localeCompare(b.label as string, undefined, { sensitivity: "base" }) + : 0; + }} filterOption={(input, option) => typeof option?.label === "string" && option?.label.toLowerCase().includes(input.toLowerCase()) } diff --git a/client/src/pages/filaments/edit.tsx b/client/src/pages/filaments/edit.tsx index 07873e5..84fe63d 100644 --- a/client/src/pages/filaments/edit.tsx +++ b/client/src/pages/filaments/edit.tsx @@ -81,6 +81,11 @@ export const FilamentEdit: React.FC = () => {