From 2006c8195c5920f81923cd33256dc176c582ffe7 Mon Sep 17 00:00:00 2001 From: dwindown Date: Wed, 5 Nov 2025 22:24:31 +0700 Subject: [PATCH] fix: Improve UX with searchable selects and higher modal z-index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Issue 1: Modal Z-Index Fixed - Increased dialog z-index: z-[9999] → z-[99999] - Now properly appears above fullscreen mode (z-50) ✅ Issue 2: Searchable Select for Large Lists - Replaced Select with SearchableSelect for: - Countries (200+ options) - Currencies (100+ options) - Timezones (400+ options) - Users can now type to search instead of scrolling - Better UX for large datasets ✅ Issue 3: Input Type Support - Input component already supports type attribute - No changes needed (already working) ✅ Issue 4: Timezone Options Fixed - Replaced optgroup (not supported) with flat list - SearchableSelect handles filtering by continent name - Shows: 'Asia/Jakarta (UTC+7:00)' - Search includes continent, city, and offset 📊 Result: - ✅ Modal always on top - ✅ Easy search for countries/currencies/timezones - ✅ No more scrolling through hundreds of options - ✅ Better accessibility Addresses user feedback issues 1-4 --- admin-spa/src/components/ui/dialog.tsx | 4 +- admin-spa/src/routes/Settings/Store.tsx | 73 +++++++++++-------------- 2 files changed, 35 insertions(+), 42 deletions(-) diff --git a/admin-spa/src/components/ui/dialog.tsx b/admin-spa/src/components/ui/dialog.tsx index 7d47744..3e3dc51 100644 --- a/admin-spa/src/components/ui/dialog.tsx +++ b/admin-spa/src/components/ui/dialog.tsx @@ -19,7 +19,7 @@ const DialogOverlay = React.forwardRef< - + updateSetting('country', v)} + options={countries.map((country: { code: string; name: string }) => ({ + value: country.code, + label: country.name, + searchText: country.name, + }))} + placeholder="Select country..." + /> @@ -293,18 +292,16 @@ export default function StoreDetailsPage() { description="How prices are displayed in your store" > - + updateSetting('currency', v)} + options={currencies.map((currency: { code: string; name: string; symbol: string }) => ({ + value: currency.code, + label: `${currency.name} (${currency.symbol})`, + searchText: `${currency.code} ${currency.name} ${currency.symbol}`, + }))} + placeholder="Select currency..." + /> @@ -377,22 +374,18 @@ export default function StoreDetailsPage() { description="Timezone and measurement units" > - + updateSetting('timezone', v)} + options={Object.entries(timezones).flatMap(([continent, tzList]: [string, any]) => + tzList.map((tz: { value: string; label: string; offset: string }) => ({ + value: tz.value, + label: `${tz.label} (${tz.offset})`, + searchText: `${continent} ${tz.label} ${tz.offset}`, + })) + )} + placeholder="Select timezone..." + />