From e1b2206d284396c4f6d6cb815cc6ebcc0a4da515 Mon Sep 17 00:00:00 2001 From: Catalin Pit <25515812+catalinpit@users.noreply.github.com> Date: Tue, 10 Sep 2024 06:15:47 +0300 Subject: [PATCH] fix: select field ux (#1334) When the Select field has a default value, it automatically signs with it. If you change it, you need to refresh the page to re-sign again with that value. This PR improves the UX by making the default value "selectable" in the dropdown menu. ## Summary by CodeRabbit - **New Features** - Updated the `DropdownField` component to simplify the handling of default values, ensuring the dropdown starts without a pre-selected option. - Improved the clarity of the placeholder text in the dropdown, enhancing user experience. --- apps/web/src/app/(signing)/sign/[token]/dropdown-field.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/(signing)/sign/[token]/dropdown-field.tsx b/apps/web/src/app/(signing)/sign/[token]/dropdown-field.tsx index a998ee696..f757321af 100644 --- a/apps/web/src/app/(signing)/sign/[token]/dropdown-field.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/dropdown-field.tsx @@ -127,7 +127,7 @@ export const DropdownField = ({ await removeSignedFieldWithToken(payload); } - setLocalChoice(parsedFieldMeta.defaultValue ?? ''); + setLocalChoice(''); startTransition(() => router.refresh()); } catch (err) { console.error(err); @@ -179,7 +179,7 @@ export const DropdownField = ({ {!field.inserted && (

- - + {parsedFieldMeta?.values?.map((item, index) => (