This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit d180322f8894a4596fb46af44c734ecfc6d04679
Author: shuai <[email protected]>
AuthorDate: Fri Jul 12 17:48:14 2024 +0800

    fix: formdata assignment order adjustment
---
 ui/src/pages/Questions/Ask/index.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/src/pages/Questions/Ask/index.tsx 
b/ui/src/pages/Questions/Ask/index.tsx
index 30398f2f..f9517936 100644
--- a/ui/src/pages/Questions/Ask/index.tsx
+++ b/ui/src/pages/Questions/Ask/index.tsx
@@ -147,6 +147,7 @@ const Ask = () => {
           const file = fm<any>(decodeURIComponent(prefill));
           formData.title.value = file.attributes?.title;
           formData.content.value = file.body;
+          setFormData({ ...formData });
           if (!queryTags && file.attributes?.tags) {
             updateTags(file.attributes.tags);
           }
@@ -157,9 +158,8 @@ const Ask = () => {
           formData.answer_content.value = draft.answer_content;
           setCheckState(Boolean(draft.answer_content));
           setHasDraft(true);
+          setFormData({ ...formData });
         }
-
-        setFormData({ ...formData });
       } else {
         resetForm();
       }

Reply via email to