From 1ea357c146760ac82a9955f1751b3a1588140ead Mon Sep 17 00:00:00 2001 From: starheim98 Date: Wed, 13 Nov 2024 13:38:47 +0100 Subject: [PATCH 1/2] change unit saves answer --- frontend/beCompliant/src/components/answers/TimeAnswer.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/beCompliant/src/components/answers/TimeAnswer.tsx b/frontend/beCompliant/src/components/answers/TimeAnswer.tsx index 0e7046c7..20621e90 100644 --- a/frontend/beCompliant/src/components/answers/TimeAnswer.tsx +++ b/frontend/beCompliant/src/components/answers/TimeAnswer.tsx @@ -50,6 +50,9 @@ export function TimeAnswer({ const handleTimeAnswerUnit = (e: React.ChangeEvent) => { const timeUnit = e.target.value; setAnswerUnit(timeUnit); + if (value) { + submitAnswer(value, timeUnit); + } }; return ( @@ -59,12 +62,12 @@ export function TimeAnswer({ { if (value != initialValue || unit != initialUnit) { submitAnswer(value ?? '', unit); } }} + type="number" />