ricos
ricos copied to clipboard
[BUG] isContentEqual returns different result depending on param order
If the difference between contents is only data
property (at least reproduced with this property, haven't tried other) in the blocks.
Then the result of the isContentEqual
function will depend on the order of parameters.
example:
const content1 = {
entityMap: {},
blocks: [
{
key: 'content-key',
text: 'some-text',
type: 'unstyled',
depth: 0,
inlineStyleRanges: [],
entityRanges: [],
data: {},
},
],
VERSION: '8.42.2',
};
const content2 = {
entityMap: {},
blocks: [
{
key: 'content-key',
text: 'some-text',
type: 'unstyled',
depth: 0,
inlineStyleRanges: [],
entityRanges: [],
data: {
anything: 'here',
},
},
],
VERSION: '8.42.2',
};
then we will have:
isContentEqual(content1, content2) === true
isContentEqual(content2,content1) === false
Expected bahaviour:
in both cases isContentEqual
should return false
.
lib Version: 8.54.2
@EdgBuc thanks for reporting! will be fixed in following releases