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

Type of bind:this on svg elements is HTMLElement #447

Closed
sorig opened this issue Aug 11, 2020 · 0 comments
Closed

Type of bind:this on svg elements is HTMLElement #447

sorig opened this issue Aug 11, 2020 · 0 comments
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@sorig
Copy link

sorig commented Aug 11, 2020

Describe the bug
Creating a this binding on svg elements is not correctly typed.

To Reproduce

  1. Create a fresh typescript template project.

  2. Replace the content of App.svelte with:

<script lang="ts">
	let group : SVGElement;
</script>

<main>
	<svg>
		<g bind:this={group}></g>
	</svg>
</main>
  1. Run npm run validate. The following error is returned.
./svelte-typescript-app/src/App.svelte:7:17
Error: Argument of type 'SVGElement' is not assignable to parameter of type 'HTMLElement'.
  Type 'SVGElement' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 16 more. (ts)

Expected behavior
group should be of type SVGElement

System (please complete the following information):

  • OS: macOS
  • IDE: VSCode
  • Plugin/Package: "Svelte for VSCode", svelte-check
@sorig sorig added the bug Something isn't working label Aug 11, 2020
dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Aug 11, 2020
Using the same strategy as for `use:`
sveltejs#447
dummdidumm added a commit that referenced this issue Aug 11, 2020
Using the same strategy as for `use:`
#447
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants