From 95b1a5caba8a476a2dae13d10ac0ac79dc6f33fe Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Tue, 21 Nov 2023 09:31:28 +0200
Subject: [PATCH] fix questions feedback

---
 editors/demo/src/HHMI/HHMI.js                   |  2 +-
 wax-prosemirror-core/index.js                   |  5 +++++
 .../components/FeedbackComponent.js             | 17 ++++++++---------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/editors/demo/src/HHMI/HHMI.js b/editors/demo/src/HHMI/HHMI.js
index 4c1d96095..baed57f47 100644
--- a/editors/demo/src/HHMI/HHMI.js
+++ b/editors/demo/src/HHMI/HHMI.js
@@ -195,7 +195,7 @@ const Hhmi = () => {
         // targetFormat="JSON"
         readonly={readOnly}
         layout={HhmiLayout}
-        onChange={source => console.log(source)}
+        // onChange={source => console.log(source)}
       />
     </>
   );
diff --git a/wax-prosemirror-core/index.js b/wax-prosemirror-core/index.js
index f6f7a4641..27a9bd09d 100644
--- a/wax-prosemirror-core/index.js
+++ b/wax-prosemirror-core/index.js
@@ -52,3 +52,8 @@ export { default as Button } from './src/components/Button';
 /* Plugins */
 
 export { default as FakeCursorPlugin } from './src/config/plugins/FakeCursorPlugin';
+
+// export * from 'prosemirror-state';
+// export * from 'prosemirror-view';
+// export * from 'prosemirror-model';
+// export * from 'prosemirror-transform';
diff --git a/wax-questions-service/src/MultipleChoiceQuestionService/components/FeedbackComponent.js b/wax-questions-service/src/MultipleChoiceQuestionService/components/FeedbackComponent.js
index 1634d5bcf..aad9196ba 100644
--- a/wax-questions-service/src/MultipleChoiceQuestionService/components/FeedbackComponent.js
+++ b/wax-questions-service/src/MultipleChoiceQuestionService/components/FeedbackComponent.js
@@ -53,6 +53,14 @@ export default ({ node, getPos, readOnly }) => {
   const [feedBack, setFeedBack] = useState(node.attrs.feedback);
   const feedBackRef = useRef(null);
 
+  const setHeight = () => {
+    const textarea = feedBackRef.current;
+    if (!textarea) return;
+    const heightLimit = 200;
+    textarea.style.height = '';
+    textarea.style.height = `${Math.min(textarea.scrollHeight, heightLimit)}px`;
+  };
+
   const feedBackInput = () => {
     setFeedBack(feedBackRef.current.value);
     const allNodes = getNodes(main);
@@ -71,14 +79,6 @@ export default ({ node, getPos, readOnly }) => {
     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`;
-  };
-
   const setNullSelection = () => {
     main.dispatch(
       main.state.tr.setSelection(TextSelection.create(main.state.tr.doc, null)),
@@ -101,7 +101,6 @@ export default ({ node, getPos, readOnly }) => {
         readOnly={readOnly}
         ref={feedBackRef}
         rows="1"
-        style={{ height: setHeight() }}
         type="text"
         value={feedBack}
       />
-- 
GitLab