fix(web): wrap disabled IconButtons in span for MUI Tooltip - #348
Merged
Conversation
…lity MUI Tooltip cannot listen to events on a disabled button element. Wrap all disabled IconButtons in a <span> so Tooltip can attach its event listeners to the span instead. Affects: inline zoom-out, zoom-in, reset-zoom; modal zoom-in, zoom-out. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Mermaid diagram zoom controls so MUI Tooltip continues to work even when the associated IconButton is disabled (by wrapping disabled tooltip children in a <span> to allow event listeners to attach).
Changes:
- Wrapped inline pill zoom-out / zoom-in / reset-zoom
IconButtons in a<span>insideTooltip. - Wrapped fullscreen modal control-pad zoom-in / zoom-out
IconButtons in a<span>insideTooltip.
Comment on lines
224
to
228
| transition: 'opacity 200ms ease', | ||
| pointerEvents: hovered ? 'auto' : 'none', | ||
| }} | ||
| > | ||
| <Tooltip title="Zoom out" placement="bottom"> |
Comment on lines
+238
to
242
| </IconButton> | ||
| </span> | ||
| </Tooltip> | ||
|
|
||
| <Tooltip title="Zoom in" placement="bottom"> |
Comment on lines
263
to
+268
| <FullscreenIcon fontSize="small" /> | ||
| </IconButton> | ||
| </Tooltip> | ||
|
|
||
| <Tooltip title="Reset zoom" placement="bottom"> | ||
| <IconButton | ||
| size="small" | ||
| aria-label="Reset zoom" | ||
| onClick={(e) => { e.stopPropagation(); setScale(1); }} | ||
| sx={{ color: pillColor, p: 0.5 }} | ||
| disabled={scale === 1} | ||
| > | ||
| <FitScreenIcon fontSize="small" /> | ||
| </IconButton> | ||
| <span> |
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.
Summary
MUI
Tooltipcannot listen to events on adisabledbutton — the browser stops all events on disabled elements. Wrapping with a<span>lets the Tooltip attach its listeners to the span instead.Affected buttons:
Test plan
🤖 Generated with Claude Code