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

add customValues Wax prop

parent 0a34c3be
No related branches found
No related tags found
1 merge request!366Questions read only
......@@ -17,12 +17,16 @@ const renderImage = file => {
const t = `<p class="paragraph"></p><div id="84db3734-94ed-4dd0-82bb-15404854df0f" class="multiple-choice"><div class="multiple-choice-question" id="38de8538-647a-489d-8474-f92d0d256c32"><p class="paragraph">question</p></div><div class="multiple-choice-option" id="debb868e-bbfe-4ba2-bf93-c963153ff791" correct="false" feedback=""><p class="paragraph">answer 1</p></div><div class="multiple-choice-option" id="810bcf10-4fcb-4d1e-9dab-ce35cbd28527" correct="false" feedback=""><p class="paragraph">answer 2</p></div></div>`;
const submitQuestions = () => {};
const Hhmi = () => {
return (
<>
<button onClick={submitQuestions}>Submit</button>
<Wax
config={config}
autoFocus
customValues={{ showFeedBack: false }}
fileUpload={file => renderImage(file)}
value={t}
readonly
......
......@@ -36,6 +36,7 @@ const Wax = forwardRef((props, ref) => {
autoFocus,
browserSpellCheck,
className,
customValues,
debug,
fileUpload,
layout,
......@@ -96,6 +97,7 @@ const Wax = forwardRef((props, ref) => {
<WaxView
autoFocus={autoFocus}
browserSpellCheck={browserSpellCheck}
customValues={customValues}
debug={debug}
fileUpload={fileUpload}
onChange={finalOnChange || (v => true)}
......
......@@ -9,7 +9,7 @@ import React, {
forwardRef,
useImperativeHandle,
} from 'react';
import { isEmpty } from 'lodash';
import applyDevTools from 'prosemirror-dev-tools';
import { EditorState } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
......@@ -29,6 +29,7 @@ const WaxView = forwardRef((props, ref) => {
let view;
const {
browserSpellCheck,
customValues,
readonly,
debug,
autoFocus,
......@@ -99,7 +100,7 @@ const WaxView = forwardRef((props, ref) => {
}
WaxEditorRef.current = node;
},
[readonly],
[readonly, customValues],
);
useEffect(() => {
......@@ -157,7 +158,7 @@ const WaxView = forwardRef((props, ref) => {
props.children({
editor,
}),
[readonly],
[readonly, customValues],
);
});
......
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