Skip to content

Commit

Permalink
Merge pull request #5476 from dfe-analytical-services/EES-5580-editab…
Browse files Browse the repository at this point in the history
…le-content-bug

EES-5580 validate EditableContentForm on submit after reinitialisation
  • Loading branch information
bennettstuart authored Dec 20, 2024
2 parents ef639a0 + 7372f24 commit 8c58d8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ const EditableContentForm = ({
onChange={setElements}
onCancelComment={toggleCommentAddForm.off}
onClickAddComment={toggleCommentAddForm.on}
onElementsReady={setElements}
onImageUpload={onImageUpload}
onImageUploadCancel={onImageUploadCancel}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default function FormFieldEditor<TFormValues extends FieldValues>({
testId,
onBlur,
onChange,
onElementsReady,
...props
}: Props<TFormValues>) {
const {
Expand Down Expand Up @@ -86,7 +87,10 @@ export default function FormFieldEditor<TFormValues extends FieldValues>({
}
}}
onElementsChange={handleElements}
onElementsReady={handleElements}
onElementsReady={els => {
handleElements(els);
onElementsReady?.(els);
}}
onChange={nextValue => {
setValue(
name,
Expand Down

0 comments on commit 8c58d8b

Please sign in to comment.