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

sveltekit:prefetch should be conditioned on the presence of href #1045

Closed
frederikhors opened this issue Apr 15, 2021 · 4 comments
Closed

sveltekit:prefetch should be conditioned on the presence of href #1045

frederikhors opened this issue Apr 15, 2021 · 4 comments
Labels

Comments

@frederikhors
Copy link
Contributor

Is your feature request related to a problem? Please describe.
sveltekit:prefetch should be conditioned on the presence of href.

How important is this feature to you?
I have many dynamics a tag, some with, some without href.

Additional context

Yes, it is valid to use the anchor tag without a href attribute.

From https://stackoverflow.com/a/33046203.

@furudean
Copy link
Contributor

How should this work? Watch the href attribute and activate prefetch behavior dynamically if a href appears?

@frederikhors
Copy link
Contributor Author

I don't know. But now, as it is, there is an error even on mouse hover.

@Rich-Harris
Copy link
Member

I cannot imagine why anyone would add a sveltekit:prefetch attribute to an href-less anchor, but this is easy enough to do: #1060

It may be technically valid to have an anchor without an href, but it's very rare that it's appropriate :)

@dummdidumm
Copy link
Member

Should this be closed now that the PR is merged?

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

No branches or pull requests

6 participants