svelteuidev / svelteui

SvelteUI Monorepo
https://svelteui.dev
MIT License
1.31k stars 62 forks source link

Button href enforces full reload on internal link #501

Closed uvulpos closed 4 months ago

uvulpos commented 4 months ago

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

When I do a reload by an native html anchor tag, svelte just does a simple fetch for the new site / requests it from storage. If I use the href property on a button, the page is doing a full reload. An externel flag or full reload flag is not set in my case. The example is the real world code I reproduced the error with

In which browser(s) did the problem occur?

Chrome

Steps To Reproduce

<script>
  import { Button } from "@svelteuidev/core";
</script>

<!-- full reload -->
<Button href={"/max/bla"}>Random String</Button>

<!-- component fetch -->
<a href={"/max/bla"}>
  <button>Zu Max</button>
</a>

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Relevant Assets

no error occurred. I guess the error is around here

uvulpos commented 4 months ago

https://github.com/svelteuidev/svelteui/assets/53957681/4c8364f9-d8f6-485b-86bf-9f706a653a06

BeeMargarida commented 4 months ago

Ah, it's the target prop that is being passed to the anchor tag. I think it can be removed

BeeMargarida commented 4 months ago

Fixed in new patch 0.15.7