[charts] Fix ChartsTooltip container and disablePortal props being ignored#22690
Merged
Conversation
Deploy previewBundle size
PerformanceTotal duration: 1,928.17 ms -268.09 ms(-12.2%) | Renders: 67 (+0) | Paint: 2,781.40 ms -366.69 ms(-11.6%)
22 tests within noise — details Check out the code infra dashboard for more information about this PR. |
JCQuintas
force-pushed
the
fix/charts-tooltip-container
branch
from
June 5, 2026 08:36
edb52d6 to
ee17d72
Compare
JCQuintas
commented
Jun 5, 2026
Co-authored-by: Jose C Quintas Jr <[email protected]> Signed-off-by: Jose C Quintas Jr <[email protected]>
alexfauquette
approved these changes
Jun 5, 2026
alexfauquette
left a comment
Member
There was a problem hiding this comment.
Another fix could be to move the ...other at the end of the component declaration. That way we can remove the other.container ?? and other.placement ??
Only the popper option need to stay after the {...other}
Contributor
|
Cherry-pick PRs will be created targeting branches: v8.x |
mbrookes
pushed a commit
to mbrookes/mui-x
that referenced
this pull request
Jun 27, 2026
…g ignored (mui#22690) Signed-off-by: Jose C Quintas Jr <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22687
Problem
ChartsTooltip'scontaineranddisablePortalprops were ignored. InChartsTooltipContainer,container={chartsLayerContainerRef.current}was hardcoded after the{...other}spread, so any user-providedcontainerwas always overwritten. With the defaultdisablePortal={false}, the tooltip was forced to portal into the chart layer container, makingcontainer={document.body}(and similar) have no effect.Fix
Respect a user-supplied
container, falling back to the chart layer container only when none is provided:disablePortalalready flowed through{...other}; it only appeared ignored because the forcedcontainerwon.Tests
Added a browser test asserting the tooltip renders inside a user-provided
container. Verified it fails before the fix and passes after.Docs
Documented the
containeranddisablePortalprops in the Tooltip page ("Portaling the tooltip" section).