-
Notifications
You must be signed in to change notification settings - Fork 4.5k
BlockBreadcrumb: Wrap text node in span tag #69605
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
Conversation
Size Change: +2 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
The change/fix looks harmless, so it's okay to merge.
P.S. The code in question was introduced four years ago (#32528), so either folks aren't using Google Translate with block editor, or there's a change in G translate code.
@adamsilverstein or @swissspidy, you might know better what the right approach is here.
Thanks for the review! After some more research, I discovered that this problem is more complicated than I thought. On approach seems to wrap the text node in some kind of tag, as in this PR, but there doesn't seem to be an ideal solution yet. References: |
Let's merge this for now. |
* BlockBreadcrumb: Wrap text node in span tag * Update snapshot Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org> Co-authored-by: Robertght <robertghetau@git.wordpress.org>
What?
Wrap the text node in the
BlockBreadcrumb
component with a span tagCloses #69597
Why?
The error that occurs is the following:
Probably, the translation feature of the Chrome browser dynamically updates the text nodes on the page, which causes the React DOM tree to get out of sync with the actual DOM tree.
How?
Simply wrap the conditionally-rendered text node in a span tag.
Testing Instructions
Screenshots or screencast
Before
2b883f92bb4be1d50f322aa05fe432b5.mp4
After
fb32184ed00de4ad5d7ec0d80ab1ece2.mp4