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

set initial value

parent 62c37b20
No related branches found
No related tags found
1 merge request!289Pm node views portals
......@@ -52,11 +52,6 @@ const Editoria = () => {
key = 'editoriaMobile';
}
const initialValue = {
type: 'doc',
content: [],
};
const EditoriaComponent = useMemo(
() => (
<>
......@@ -67,11 +62,11 @@ const Editoria = () => {
autoFocus
placeholder="Type Something..."
fileUpload={file => renderImage(file)}
value={initialValue}
value=""
targetFormat="JSON"
// readonly
layout={layout}
onChange={source => console.log(source)}
// onChange={source => console.log(source)}
user={user}
/>
</>
......
......@@ -72,8 +72,6 @@ const Wax = props => {
// const { schema } = application.schema;
const WaxOnchange = onChange || (v => true);
const editorContent = value || '';
finalPlugins = defaultPlugins.concat([
createPlaceholder(placeholder),
...application.getPlugins(),
......@@ -85,8 +83,13 @@ const Wax = props => {
};
if (targetFormat === 'JSON') {
const editorContent = value || {
type: 'doc',
content: [],
};
WaxOptions.doc = schema.nodeFromJSON(editorContent);
} else {
const editorContent = value || '';
const parse = parser(schema);
WaxOptions.doc = parse(editorContent);
}
......
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