From c78f4deaf7f386dc7faebf571b0378e1ff575ab2 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 17 Jan 2023 22:38:00 +0530 Subject: [PATCH] fix: use suffix in text field (#6532) Signed-off-by: Udit Takkar Signed-off-by: Udit Takkar --- .../components/TimeTimeUnitInput.tsx | 70 ++++++++----------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/packages/features/ee/workflows/components/TimeTimeUnitInput.tsx b/packages/features/ee/workflows/components/TimeTimeUnitInput.tsx index 987ad6a6b1..bf989f401b 100644 --- a/packages/features/ee/workflows/components/TimeTimeUnitInput.tsx +++ b/packages/features/ee/workflows/components/TimeTimeUnitInput.tsx @@ -36,49 +36,37 @@ export const TimeTimeUnitInput = (props: Props) => { defaultValue={form.getValues("time") || 24} className="-mt-2 rounded-r-none text-sm focus:ring-0" {...form.register("time", { valueAsNumber: true })} + addOnSuffix={ + + + + + + {timeUnitOptions.map((option, index) => ( + + { + setTimeUnit(option.value); + form.setValue("timeUnit", option.value); + }}> + {option.label} + + + ))} + + + } /> -
- - - - - - {timeUnitOptions.map((option, index) => ( - - {/* */} - { - setTimeUnit(option.value); - form.setValue("timeUnit", option.value); - }}> - {option.label} - - - ))} - - -
); };