diff --git a/packages/@sanity/portable-text-editor/src/editor/PortableTextEditor.tsx b/packages/@sanity/portable-text-editor/src/editor/PortableTextEditor.tsx index 5ef09ff705e..8d9cefd96e7 100644 --- a/packages/@sanity/portable-text-editor/src/editor/PortableTextEditor.tsx +++ b/packages/@sanity/portable-text-editor/src/editor/PortableTextEditor.tsx @@ -329,25 +329,13 @@ export class PortableTextEditor extends React.Component< } const isEqualToValue = !(this.props.value || []).some((blk, index) => { - if (this.slateInstance.isTextBlock(blk)) { - const compareBlock = toSlateValue( - [blk], - {portableTextFeatures: this.portableTextFeatures}, - KEY_TO_SLATE_ELEMENT.get(this.slateInstance) - )[0] - if (!isEqual(compareBlock, this.slateInstance.children[index])) { - return true - } - } else { - const slateBlock = this.slateInstance.children[index] - if ( - !slateBlock || - (slateBlock && - 'value' in slateBlock && - !isEqual(blk, {_key: slateBlock._key, _type: slateBlock._type, ...slateBlock.value})) - ) { - return true - } + const compareBlock = toSlateValue( + [blk], + {portableTextFeatures: this.portableTextFeatures}, + KEY_TO_SLATE_ELEMENT.get(this.slateInstance) + )[0] + if (!isEqual(compareBlock, this.slateInstance.children[index])) { + return true } return false })