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

Unspecified behaviour of the translate prop #2335

Closed
MichalGniadek opened this issue Jul 8, 2024 · 2 comments
Closed

Unspecified behaviour of the translate prop #2335

MichalGniadek opened this issue Jul 8, 2024 · 2 comments
Labels
Close when stale This issue is going to be closed when there is no activity for a while Repro provided

Comments

@MichalGniadek
Copy link

Question

Hi, I saw that there is a translate prop that is behaving rather strangely (Snack):

<Svg height="100" width="100">
  {/* Translated */}
  <Circle r="50" fill="green" translate={[50, 50]} />
  {/* Not translated */}
  <Circle x="0" y="0" r="50" fill="red" translate={[50, 50]} />
  <Circle r="40" fill="yellow" />
</Svg>
<Svg height="100" width="100">
  {/* Not translated */}
  <Rect width={50} height={50} fill="red" />
  {/* Not translated */}
  <Rect width={40} height={40} fill="yellow" translate={[50, 50]} />
</Svg>
  • I don't think this is specified in svg spec
  • On Web this prop works as I would expect
  • On iOS/Android this works only on Circle when there aren't x and y specified

Should this be fixed/removed/mentioned in docs?

@github-actions github-actions bot added Repro provided Missing info The user didn't precise the problem enough labels Jul 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description, Steps to reproduce, Snack or a link to a repository, SVG version, React Native version and Platforms sections.

@bohdanprog bohdanprog removed the Missing info The user didn't precise the problem enough label Jul 10, 2024
@bohdanprog
Copy link
Member

Hello @MichalGniadek,
here is a snack example of how it should work.
If you have any other questions, please don't hesitate to ask.

@bohdanprog bohdanprog added the Close when stale This issue is going to be closed when there is no activity for a while label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while Repro provided
Projects
None yet
Development

No branches or pull requests

2 participants