From fd0bcfa342356775005495350586be838c643717 Mon Sep 17 00:00:00 2001 From: wlren Date: Sun, 9 Oct 2022 00:33:22 +0800 Subject: [PATCH] [questions][ui] contribute card clickable --- .../questions/ContributeQuestionCard.tsx | 17 ++++----- .../questions/ContributeQuestionForm.tsx | 36 ++++++++++--------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/apps/portal/src/components/questions/ContributeQuestionCard.tsx b/apps/portal/src/components/questions/ContributeQuestionCard.tsx index ff492fb7..54df1080 100644 --- a/apps/portal/src/components/questions/ContributeQuestionCard.tsx +++ b/apps/portal/src/components/questions/ContributeQuestionCard.tsx @@ -15,19 +15,20 @@ export default function ContributeQuestionCard() { setShowDraftDialog(false); }; - const handleOnFocus = () => { - (document.activeElement as HTMLElement).blur(); + const handleOpenContribute = () => { setShowDraftDialog(true); }; return ( <> -
+
@@ -35,7 +36,7 @@ export default function ContributeQuestionCard() { label="Company" startAddOn={BuildingOffice2Icon} startAddOnType="icon" - onFocus={handleOnFocus} + onChange={handleOpenContribute} />
@@ -43,7 +44,7 @@ export default function ContributeQuestionCard() { label="Question type" startAddOn={QuestionMarkCircleIcon} startAddOnType="icon" - onFocus={handleOnFocus} + onChange={handleOpenContribute} />
@@ -51,14 +52,14 @@ export default function ContributeQuestionCard() { label="Date" startAddOn={CalendarDaysIcon} startAddOnType="icon" - onFocus={handleOnFocus} + onChange={handleOpenContribute} />
diff --git a/apps/portal/src/components/questions/ContributeQuestionForm.tsx b/apps/portal/src/components/questions/ContributeQuestionForm.tsx index 64daf342..b5a56edf 100644 --- a/apps/portal/src/components/questions/ContributeQuestionForm.tsx +++ b/apps/portal/src/components/questions/ContributeQuestionForm.tsx @@ -47,7 +47,7 @@ export default function ContributeQuestionForm({ }; return (