svelteuidev / svelteui

SvelteUI Monorepo
https://svelteui.dev
MIT License
1.28k stars 64 forks source link

MenuItem href does nothing #502

Closed uvulpos closed 1 month ago

uvulpos commented 2 months ago

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

does not work

<Menu>
      <Menu.Label>{$_("page.navigation.application.header")}</Menu.Label>
      <Menu.Item icon={Pencil1} href="/settings">
            Settings
      </Menu.Item> 
</Menu>

works

<Menu>
      <Menu.Label>{$_("page.navigation.application.header")}</Menu.Label>
      <a href="/settings">
            <Menu.Item icon={Pencil1} href="/settings">
                  Settings
            </Menu.Item>
      </a>
</Menu>

In which browser(s) did the problem occur?

Chrome

Steps To Reproduce

Just try out my code snippet from above, an alike issue like #501

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 response

BeeMargarida commented 1 month ago

Hey, you need to set the Menu.Item as an anchor with the root prop, like so:

<Menu.Item icon={Pencil1} root="a" href="/settings">
      Settings
</Menu.Item>
uvulpos commented 1 month ago

🤯 why do I have to care about this? This should be done by the lib, is it?