Skip to content

[material-ui][SpeedDial] Fix horizontal persistent tooltip placement - #49073

Open
Cunninger wants to merge 10 commits into
mui:masterfrom
Cunninger:codex/issue-41067-speeddial-tooltip-placement
Open

[material-ui][SpeedDial] Fix horizontal persistent tooltip placement#49073
Cunninger wants to merge 10 commits into
mui:masterfrom
Cunninger:codex/issue-41067-speeddial-tooltip-placement

Conversation

@Cunninger

@Cunninger Cunninger commented Aug 31, 2026

Copy link
Copy Markdown

Fixes #41067.

Summary

Persistent SpeedDialAction tooltips (slotProps.tooltip.open) had no styles for the top and bottom placements, which horizontal SpeedDials use by default, so the label was drawn on top of its action.

  • Add top and bottom styles for the persistent label. The label sits in a zero-height grid row, so it widens its action instead of overlapping the neighboring labels, and it stays on one line.
  • Style compound placements like top-start like their side, as Tooltip does, and fall back to left for placements without a side, like auto. Both used to get no styles at all.
  • Keep each Fab next to its label when a sibling action is larger. Vertical speed dials render exactly as before.
  • Keep top as the default placement for the left and right directions, so hover tooltips are unchanged.
  • Correct the class descriptions and the SpeedDial docs, which still referred to the tooltipOpen and tooltipPlacement props removed in v9, and the accessibility note, which mentioned an aria-describedby that isn't set.

Trade-offs

These follow from giving each label its own space in horizontal speed dials:

  • Each action is as wide as its label, so the Fabs are no longer evenly spaced when the labels have different lengths.
  • The actions keep that width while the speed dial is closed, like they already keep their Fab width. Nothing moves when it opens or closes, and a main Fab anchored in its corner stays there.
  • As with left and right labels, the label is drawn outside the action's box: it can be clipped by an overflow: hidden container, or go past the top of the page for a speed dial at the top edge (use placement: 'bottom' there).
  • Labels above or below the actions suit horizontal speed dials only; on vertical ones they cover the action above or below. The docs now say which placement to use for each direction.

Test plan

  • Browser tests place the label on all four sides, for compound placements and for auto: 16px from its Fab, centered on it, without making the action taller.
  • Browser tests render horizontal speed dials in both directions with labels of different lengths and one larger action: labels stay 16px apart on one line, Fabs stay aligned, and closing the speed dial doesn't change its layout.
  • A browser test checks that vertical speed dials keep their labels lined up when action sizes differ.
  • JSDOM tests check the placement class SpeedDial sets for each direction, and the class for compound and auto placements.
  • The SpeedDial/Directions regression fixture now also renders the left and right directions.

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+646B(+0.12%) 🔺+118B(+0.08%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@zannager zannager added the scope: speed dial Changes related to the speed dial. label Aug 31, 2026
@zannager
zannager requested a review from sai6855 August 31, 2026 14:07

@sai6855 sai6855 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cunninger Existing tests are failing, can you check?

sai6855 and others added 9 commits September 11, 2026 12:38
…directions

The new top and bottom static tooltip styles fix the overlap on their own,
so the default placement doesn't need to change. Switching it to bottom
would also move the hover tooltip of every horizontal SpeedDial.
Browsers resolve `bottom: 100%` to a pixel value in getComputedStyle, so the
computed style assertion only passed in JSDOM. Check where the label sits
relative to the Fab instead, and skip in JSDOM since it has no layout.
Also drop the stray backtick from the tooltipPlacement* class descriptions
so the placement renders as code in the API docs.
…rt from neighbors

- Style compound placements like `top-start` like their side, as Tooltip
  does. They used to get no styles, which left the label on top of the Fab.
- Lay out top and bottom labels in a zero-height grid row, so each label
  widens its action instead of overlapping its neighbors or wrapping.
- Center the root on the cross axis, so a larger sibling action doesn't
  stretch it and pull the Fab away from its label.
- Render the left and right directions in the SpeedDial regression fixture.
The class descriptions and the SpeedDial docs still referred to the
`tooltipOpen` and `tooltipPlacement` props, which were removed in v9.
… without a side

- Only center the root for top and bottom labels, so vertical speed dials
  keep their label column when action sizes differ.
- Fall back to the left for placements without a side, like `auto`,
  instead of leaving the label unstyled on top of the Fab.
- Test the left direction, the closed state, the spacing between labels,
  and that the label doesn't make the action taller.
Say which placements suit each direction and how horizontal speed dials
make room for their labels. Also correct the accessibility note: actions
are labeled by their tooltip title, not described by it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: speed dial Changes related to the speed dial.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[material-ui][SpeedDial] Bug with right/left direction in persistent action tooltips

3 participants