Skip to content
Snippets Groups Projects
Commit d8a51bd9 authored by chris's avatar chris
Browse files

fix

parent c7ba59d2
No related branches found
No related tags found
1 merge request!430Hhmi issues
...@@ -67,11 +67,16 @@ export default ({ node, getPos, readOnly }) => { ...@@ -67,11 +67,16 @@ export default ({ node, getPos, readOnly }) => {
} }
}); });
setNullSelection(); setNullSelection();
setHeight();
return false;
};
const setHeight = () => {
const textarea = feedBackRef.current; const textarea = feedBackRef.current;
if (!textarea) return;
const heightLimit = 200; const heightLimit = 200;
textarea.style.height = ''; textarea.style.height = '';
textarea.style.height = `${Math.min(textarea.scrollHeight, heightLimit)}px`; textarea.style.height = `${Math.min(textarea.scrollHeight, heightLimit)}px`;
return false;
}; };
const setNullSelection = () => { const setNullSelection = () => {
...@@ -97,6 +102,7 @@ export default ({ node, getPos, readOnly }) => { ...@@ -97,6 +102,7 @@ export default ({ node, getPos, readOnly }) => {
readOnly={readOnly} readOnly={readOnly}
ref={feedBackRef} ref={feedBackRef}
rows="1" rows="1"
style={{ height: setHeight() }}
type="text" type="text"
value={feedBack} value={feedBack}
/> />
...@@ -112,7 +118,10 @@ const getNodes = view => { ...@@ -112,7 +118,10 @@ const getNodes = view => {
node.node.type.name === 'multiple_choice' || node.node.type.name === 'multiple_choice' ||
node.node.type.name === 'multiple_choice_single_correct' || node.node.type.name === 'multiple_choice_single_correct' ||
node.node.type.name === 'true_false' || 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); multipleChoiceNodes.push(node);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment