Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of LineChart display on Safari (iPhone) #783

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rodnoycry
Copy link

This is fix that I found to the issue I filed recently: #782
As I mentioned there are some differences in displaying <svg> element on Safari when no viewport prop specified, and originally LineChart was displayed like this in my minimal reproduction repo:

Deployed example for quick check: https://safari-charts-bug.vercel.app/

As I found out the problem was with method lineSvgComponent of LineChart component. Original code didn't provide any viewport or size of SVG element:

    return (
      <Svg onPress={props.onBackgroundPress}>

There was a few options to fix this issue - specify height prop, specify viewport prop, but I decided to apply style with { overflow: "visible" } as in my opinion most universal option. After this changes LineChart started to display as expected:

Branch of example repo with applied patch: https://github.com/rodnoycry/safari-charts-bug/tree/fixed

Deployed example (you need to copy and paste exact link, as it in preview state of deploy):
https://safari-charts-bug-git-fixed-rodnoycrys-projects.vercel.app/?_vercel_share=soSBCrIc6VDSWWArC7WcvJssXF0AhQr1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant