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: Add transform-origin to SVGAttributes #9326

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Conversation

molily
Copy link
Contributor

@molily molily commented Oct 18, 2023

<rect
  x="10"
  y="10"
  width="10"
  height="10"
  transform="scale(2)"
  transform-origin="10 10"
/>

gives the following error in VS Code

Argument of type '{ x: string; y: string; width: string; height: string; transform: string; "transform-origin": string; }' is not assignable to parameter of type 'HTMLProps<"rect", SVGAttributes<any>>'.
  Object literal may only specify known properties, and '"transform-origin"' does not exist in type 'HTMLProps<"rect", SVGAttributes<any>>'. js(2345)

transform-origin can be set as a presentational attribute but it's missing in the SVGAttributes.

See:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin
https://www.w3.org/TR/SVG2/styling.html#PresentationAttributes (missing in the original spec, I guess it was forgotten)
https://svgwg.org/svg2-draft/styling.html#PresentationAttributes (added in the latest draft)

Do we also need to add transform-origin to packages/svelte/src/compiler/compile/render_dom/wrappers/Element/fix_attribute_casing.js then?

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2023

⚠️ No Changeset found

Latest commit: 8facc23

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Adding it to that other file isn't needed

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.

2 participants