You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Realistically this will be very difficult to fix, mostly for tracking purposes.
Currently React and Google translate does not play nice where google translate will mutate the DOM to a state where it will be inconsistent to Reacts view of the world.
React will reference the text node in its virtual DOM (not the div) which no longer exists after browser translation is ran. For conditionally rendered components this is an issue because when React goes to call parent.removeChild(textNode) in the event the component is to be unrendered, textNode no longer exists in the real DOM which throws Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
The workaround provided on the ticket suggested wrapping all textNodes in a span such that React will still reference the span even when the contents inside the span are replaced with font, allowing it to still maintain the same reference between virtual and real DOM.
So far just identified MenuItem rendering textNodes but basically any component using TextNode will have this issue
The text was updated successfully, but these errors were encountered:
donghee214
changed the title
MenuItem Component should wrap text content in <span></span>
MenuItem Component should wrap text content in span
Jan 6, 2025
Realistically this will be very difficult to fix, mostly for tracking purposes.
Currently React and Google translate does not play nice where google translate will mutate the DOM to a state where it will be inconsistent to Reacts view of the world.
React will reference the text node in its virtual DOM (not the div) which no longer exists after browser translation is ran. For conditionally rendered components this is an issue because when React goes to call
parent.removeChild(textNode)
in the event the component is to be unrendered, textNode no longer exists in the real DOM which throwsFailed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
The workaround provided on the ticket suggested wrapping all textNodes in a
span
such that React will still reference the span even when the contents inside the span are replaced withfont
, allowing it to still maintain the same reference between virtual and real DOM.So far just identified
MenuItem
rendering textNodes but basically any component using TextNode will have this issueTextNode defaults to div: https://github.com/palantir/blueprint/blob/develop/packages/core/src/components/menu/menuItem.tsx#L270
React Issue: facebook/react#11538
The text was updated successfully, but these errors were encountered: