Skip to content

Commit bfdd8ec

Browse files
authored
Merge pull request #177 from CS3219-AY2425S1/fix/bug/edit-question-modal
Fix edit question modal bug
2 parents d66ba75 + b41139f commit bfdd8ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/components/questions/question-form-modal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ const QuestionFormModal: React.FC<QuestionFormModalProps> = ({ ...props }) => {
5252
e.preventDefault();
5353

5454
props.handleSubmit(question);
55-
setQuestion(initialQuestionState);
55+
if (props.initialData) {
56+
setQuestion(props.initialData);
57+
} else {
58+
setQuestion(initialQuestionState);
59+
}
5660
};
5761

5862
const handleExit = () => {

0 commit comments

Comments
 (0)