FormidableLabs / FormidableLabs/victory
Tooltip line height not correctly applied to both flyout and text elements
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 536
- PR merge metrics
- No merged PRs in 30d
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
### Victory version
37.1.1
### Code Sandbox link
https://codesandbox.io/p/sandbox/victory-starter-forked-4kq4n4?file=%2Fsrc%2FApp.tsx
### Bug report
When specifying `Theme.tooltip.style.lineHeight` the value is used to calculate the height of the tooltip flyout but not the positioning of text elements inside. This causes a visual mismatch, especially on multiline tooltips.
It seems the only workaround is to also supply line height to the tooltip label via props, but this means the value now has to be maintained across two separate places in the code:
```
} />
```
Ideally we'd only need to maintain line height in one place, the theme.
### Steps to reproduce
```markdown
1. Go to Code Sandbox link and open `Theme.ts`
2. Modify the value of `Theme.tooltip.style.lineHeight`
3. Observe how the height of the tooltip Flyout changes but not the positioning of text elements
```
### Expected behavior
```markdown
`Theme.tooltip.style.lineHeight` should be used to calculate both the height of the flyout and the position of the text elements.
```
### Actual behavior
```markdown
`Theme.tooltip.style.lineHeight` is only used to calculate the height of the flyout.
```
### Environment
```markdown
- Device: Desktop
- OS: MacOS 14.6.1
- Browser: Chrome v129
```
Contributor guide
Assessment
This issue has not been assessed yet.