Open Tug opened 5 years ago
Is this the same issue than #227?
Yes, it's very close. I suggest we close #227 though as we don't use a hash anymore to check that something has changed
@Tug is this something that we still want to pursue?
We'd still want to have a performant way of checking for content dirtiness so, marking this as an enhancement and adding it to the Backlog.
Currently we detect if a post is modified by checking if the resulting html changed:
See: https://github.com/wordpress-mobile/gutenberg-mobile/pull/225 https://github.com/wordpress-mobile/gutenberg-mobile/pull/242 https://github.com/wordpress-mobile/gutenberg-mobile/pull/264
We'd like to improve on that logic and reuse the
isEditedPostDirty
selector from the gutenberg store.However there are a few road blocks along the way:
parse
andserialize
of blocks isn't always symmetric. For instance:(notice the
;
at the end oftext-align:center
)Some blocks are updated when the post loads. For instance
paragraph
andheading
both use theRichText
component and modify the attributes inonContentSizeChange
. ButonContentSizeChange
is called on load byRCTAztecView
(RichText underline component).