From e5b7816dec2e71d436afe408b1a0f81ca8273399 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Thu, 1 Aug 2024 10:33:37 +0200 Subject: [PATCH] clear error message on text change --- src/components/FeedbackSurvey.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/FeedbackSurvey.tsx b/src/components/FeedbackSurvey.tsx index db5db3ee447d9..71b0da06bd5fd 100644 --- a/src/components/FeedbackSurvey.tsx +++ b/src/components/FeedbackSurvey.tsx @@ -72,6 +72,14 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe onSubmit(reason.key, note.trim()); }; + const handleSetNote = (text: string) => { + setNote(text); + + if (isNoteRequired && shouldShowReasonError) { + setShouldShowReasonError(false); + } + }; + return ( @@ -91,7 +99,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe label={translate('feedbackSurvey.additionalInfoInputLabel')} accessibilityLabel={translate('feedbackSurvey.additionalInfoInputLabel')} role={CONST.ROLE.PRESENTATION} - onChangeText={setNote} + onChangeText={handleSetNote} value={note} />