svelteuidev / svelteui

SvelteUI Monorepo
https://svelteui.dev
MIT License
1.29k stars 63 forks source link

Button witth `href` attribute breaks SvelteKit client-side routing #472

Open notramo opened 1 year ago

notramo commented 1 year ago

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

The Button component causes a full page reload when used with the href attribute. It is really annoying because the app is unusable for a few seconds (rebuilding entire UI) instead of blazing-fast preloaded navigation.

I guess this is caused by the dynamic tag rendering, that switches between <a> and <button>, based on the href attribute.

In which browser(s) did the problem occur?

Other - list in description

Steps To Reproduce

In a SvelteKit project with link preload and client-side routing enabled, add a Button with href attribute, e.g. <Button href="/login">Login</Button>.