From d8a51bd9daba518e1a8eef3223065a86e02c0689 Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Tue, 20 Dec 2022 11:31:46 +0200
Subject: [PATCH] fix

---
 .../components/FeedbackComponent.js                 | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/FeedbackComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/FeedbackComponent.js
index 625048a4d..ade5c99e7 100644
--- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/FeedbackComponent.js
+++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/FeedbackComponent.js
@@ -67,11 +67,16 @@ export default ({ node, getPos, readOnly }) => {
       }
     });
     setNullSelection();
+    setHeight();
+    return false;
+  };
+
+  const setHeight = () => {
     const textarea = feedBackRef.current;
+    if (!textarea) return;
     const heightLimit = 200;
     textarea.style.height = '';
     textarea.style.height = `${Math.min(textarea.scrollHeight, heightLimit)}px`;
-    return false;
   };
 
   const setNullSelection = () => {
@@ -97,6 +102,7 @@ export default ({ node, getPos, readOnly }) => {
         readOnly={readOnly}
         ref={feedBackRef}
         rows="1"
+        style={{ height: setHeight() }}
         type="text"
         value={feedBack}
       />
@@ -112,7 +118,10 @@ const getNodes = view => {
       node.node.type.name === 'multiple_choice' ||
       node.node.type.name === 'multiple_choice_single_correct' ||
       node.node.type.name === 'true_false' ||
-      node.node.type.name === 'true_false_single_correct'
+      node.node.type.name === 'true_false_single_correct' ||
+      node.node.type.name === 'matching_container' ||
+      node.node.type.name === 'fill_the_gap_container' ||
+      node.node.type.name === 'multiple_drop_down_container'
     ) {
       multipleChoiceNodes.push(node);
     }
-- 
GitLab