@@ -78,7 +78,7 @@ const FieldComponent: React.FC<Props> = (props) => {
7878 } > ( {
7979 path, // required
8080 validate : memoizedValidate ,
81- condition,
81+ condition : condition ?? undefined ,
8282 } ) ;
8383
8484 // Here is what `useField` sends back
@@ -126,22 +126,28 @@ const FieldComponent: React.FC<Props> = (props) => {
126126 } }
127127 >
128128 < EditorProviders
129+ initialJSON = { getJsonContentFromValue ( value ) }
130+ editorConfig = { editorConfig }
131+ initialComments = { value ?. comments }
132+ value = { value }
133+ setValue = { setValue }
129134 onChange = { (
130135 editorState : EditorState ,
131136 editor : LexicalEditor ,
132137 tags : Set < string > ,
133138 commentStore : CommentStore
134139 ) => {
135140 const json = editorState . toJSON ( ) ;
136- const valueJsonContent = getJsonContentFromValue ( value ) ;
141+ // const valueJsonContent = getJsonContentFromValue(value);
137142 // TODO: Wondering why the deepEqual was here since if we set
138143 // ignoreSelectionChange={true} in our OnChangePlugin instances
139144 // - a call here means that something _must_ have changed - and so
140145 // not sure that we need to do any comparison at all?
141146 // TODO: Revisit if neccessary, but Lexical confirmed that ignoreSelectionChange={true}
142147 // should be fine in this case, and so we don't need to deepEqual and can trust
143148 // that an onChange event here means 'something' actually changed.
144- if ( ! ( readOnly ?? false ) && valueJsonContent != null ) {
149+ // if (!(readOnly ?? false) && valueJsonContent != null) {
150+ if ( ! ( readOnly ?? false ) ) {
145151 const textContent = editor . getEditorState ( ) . read ( ( ) => {
146152 return $getRoot ( ) . getTextContent ( ) ;
147153 } ) ;
@@ -174,11 +180,6 @@ const FieldComponent: React.FC<Props> = (props) => {
174180 } ) ;
175181 }
176182 } }
177- initialJSON = { getJsonContentFromValue ( value ) }
178- editorConfig = { editorConfig }
179- initialComments = { value ?. comments }
180- value = { value }
181- setValue = { setValue }
182183 />
183184 < FieldDescription value = { value } description = { description } />
184185 </ ErrorBoundary >
0 commit comments