-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rich Text: Remove componentDidUpdate deep equality conditions #7648
Conversation
// This fixes issues in multi richText blocks like quotes when moving the focus between | ||
// the different editables. | ||
! isEqual( this.props.value, prevProps.value ) && | ||
! isEqual( this.props.value, this.savedContent ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there be any point in keeping the check to log a warning in dev mode if values are the same but an update is triggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there be any point in keeping the check to log a warning in dev mode if values are the same but an update is triggered?
I love that idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scolding added in 320c96e7108fbc6fd1e536656ee2304ae32ece49
Mentioned elsewhere, while I can get on board with this for things which are proper browser dependencies, I don't think
https://developer.mozilla.org/en-US/docs/Web/API/Console Could even be argued that targeting |
320c96e
to
59cfb2c
Compare
Rebased to account for the since-merged #7620 blocker. I'm finding there's an unexpected failing end-to-end test now though, in the multi-selection suite. I can sometimes reproduce in the browser, but it's mostly to do with where the click occurs (e.g. in sibling inserter space, which is technically outside of the event scope of the It also led me to find that our quote block, with it's gutenberg/core-blocks/quote/index.js Line 196 in 66581eb
(Made evidenced by our wonderful new scolding logging) |
59cfb2c
to
ce4cb90
Compare
Rebased to keep this one fresh. It's something I'd still like to move forward on. There's two failing end-to-end tests either, neither of which I'm yet certain the cause.
This one is intermittent. I'm wondering if it could perhaps be an issue of TinyMCE initialization time. I had seen this at one point earlier in authoring end-to-end tests (#6467, which included some hacks/workarounds like
|
I'm not sure why I put it API freeze. It doesn't look like it touches public API. Anyways, it needs another rebase. When you do it please include in the milestone :) |
Superseded by #7890 |
This pull request seeks to simplify the RichText component, removing two deep equality conditions performed on each component update. These were introduced in #5100 to resolve an issue described in #5081. The issue is in-fact related to forceful focusing caused by
updateContent
, which is slated to be separately resolved by #7620 in checking that the editor has focus when restoring the stored bookmark when setting content.Thus, this pull request is considered blocked by #7620. There is an added end-to-end test here which fails as expected from the steps described in #5081, and are expected to pass once #7620 is merged and this pull request rebased.Speaking more broadly, it is an issue that we cannot trust that content has changed unexpectedly without a deep equality check. We should not need to rely on these conditions. Strict equality should be sufficient.
Testing instructions:
Repeat testing instructions from #5100.
Ensure end-to-end tests pass: