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

Svelte warning "HTMLAnchorElement" is not defined, but it is #7223

Closed
blaumeise20 opened this issue Feb 4, 2022 · 1 comment · Fixed by #7786
Closed

Svelte warning "HTMLAnchorElement" is not defined, but it is #7223

blaumeise20 opened this issue Feb 4, 2022 · 1 comment · Fixed by #7786

Comments

@blaumeise20
Copy link
Contributor

blaumeise20 commented Feb 4, 2022

Describe the bug

I have an event handler where I check if event.target is HTMLAnchorElement, but svelte gives me a warning.

Reproduction

<a href="/" on:click={e => console.log(e.target instanceof HTMLAnchorElement)}>hello</a>

Logs

No logs, just the warning.

System Info

System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 3.63 GB / 64.00 GB
    Shell: 5.7.1 - /bin/zsh
Binaries:
    Node: 17.4.0 - /usr/local/bin/node
    npm: 7.14.0 - /usr/local/bin/npm
npmPackages:
    svelte: ^3.37.0 => 3.46.3 
    webpack: ^5.68.0 => 5.68.0

Severity

annoyance

@jasonlyu123 jasonlyu123 added the good first issue A small, encapsulated issue, ideal for a new contributor to Svelte to tackle. label Feb 4, 2022
@jasonlyu123
Copy link
Member

Although it's an easy fix. But since we don't have all the element-specific constructors in the known global. If we want to do it. Maybe we can grab it from a list like mdn data?

@jasonlyu123 jasonlyu123 removed the good first issue A small, encapsulated issue, ideal for a new contributor to Svelte to tackle. label Feb 4, 2022
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 a pull request may close this issue.

2 participants