-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[form-builder] Fix race condition when patching block node values (#333)
- Loading branch information
Showing
9 changed files
with
76 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/@sanity/form-builder/src/inputs/BlockEditor-slate/createBlockNode.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from 'react' | ||
import FormBuilderBlock from './FormBuilderBlock' | ||
|
||
export default function createBlockNode(type) { | ||
export default function createBlockNode(type, onPatch) { | ||
return function BlockNode(props) { | ||
return <FormBuilderBlock type={type} {...props} /> | ||
return <FormBuilderBlock type={type} {...props} onPatch={onPatch} /> | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/@sanity/form-builder/src/inputs/BlockEditor-slate/createInlineNode.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from 'react' | ||
import FormBuilderInline from './FormBuilderInline' | ||
|
||
export default function createInlineNode(type) { | ||
export default function createInlineNode(type, onPatch) { | ||
return function InlineNode(props) { | ||
return <FormBuilderInline type={type} {...props} /> | ||
return <FormBuilderInline type={type} {...props} onPatch={onPatch} /> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters