Skip to content

Commit

Permalink
[charts] Fix text position in Safari (#10815)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com>
  • Loading branch information
lhilgert9 and alexfauquette authored Oct 26, 2023
1 parent 2993154 commit 2cbc8df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/x-charts/src/internals/components/ChartsText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ export function ChartsText(props: ChartsTextProps) {
style={style}
>
{wordsByLines.map((line, index) => (
<tspan x={x} dy={`${index === 0 ? startDy : wordsByLines[0].height}px`} key={index}>
<tspan
x={x}
dy={`${index === 0 ? startDy : wordsByLines[0].height}px`}
dominantBaseline={dominantBaseline} // Propagated to fix Safari issue: https://github.com/mui/mui-x/issues/10808
key={index}
>
{line.text}
</tspan>
))}
Expand Down

0 comments on commit 2cbc8df

Please sign in to comment.