Repository navigation
Keep org chart avatars inside their cards in Safari - #103
Merged
IanCou merged 1 commit intoOct 22, 2026
Merged
Conversation
WebKit paints positioned elements inside an SVG foreignObject against the SVG origin and ignores the transforms react-d3-tree puts on each node, so the Avatar root (relative overflow-hidden) rendered every photo in a row at the top of the chart. static drops the positioning; the rounded clip still works without it.
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.
Description
In Safari, the profile photos on the Org Chart (
/org/chart) render in a row at the top of the chart instead of inside each person's card, and the cards show no avatar at all. Chrome and Firefox are unaffected.Each card is HTML inside an SVG
<foreignObject>, and the shadcnAvatarroot isrelative overflow-hidden. WebKit paints positioned elements inside aforeignObjectrelative to the SVG origin and ignores thetransformthat react-d3-tree puts on each node's<g>, so every avatar lands near the top left of the canvas.This adds
staticto the Avatar's classes inOrgChartVisualization.tsxonly. tailwind-merge dropsrelativein favour of it, and the round crop still works becauseoverflow-hiddenwithrounded-fulldoes not need positioning. The sharedAvatarcomponent is unchanged.Type of Change
Testing
On corp.appdevclub.com in Safari, unticking
position: relativeon an avatar'sspan[data-slot="avatar"]in Web Inspector moves the photo back into its card. That is the same change this PR makes in code. Locally:vitest runpasses (29),prettier --checkandeslintare clean for the file, andvite buildsucceeds.Screenshots
Before (Safari): photos at the top of the chart, cards without avatars. I can add the screenshot in a comment.
Checklist