You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given those constraints I'm not able to customize the shadcn-svelte tabs component using links, as the builder action does a event.preventDefault(), resulting in disabling the navigation to the href of the link:
Could the addition of my requirement (utilizing links for tabs) be considered for inclusion in the roadmap, or is there a reason why it's not advisable (e.g. accessibility issues)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using shadcn-svelte+bits-ui+melt-ui to create tabs in my app.
Example repo
https://gitlab.com/cbenz/test-shadcn-tabs-links
My need
I'd like the user to be able to open each tab into a new browser tab, or to be able to copy the URL of each tab.
Until now, before using melt-ui, I implemented tabs with
<a href="?tab=value">
.The problem
It seems that bits-ui hard-codes the
<button>
element for the tab trigger:https://github.com/huntabyte/bits-ui/blob/1095389e3f2a24857e08c06a0f7244262b4f2600/src/lib/bits/tabs/components/tabs-trigger.svelte#L30-L40
Even melt-ui at the lower level seems to expect a
<button>
only, as it outputstype="button"
:https://github.com/melt-ui/melt-ui/blob/2863c17ed17d46cb7c0a62fa65bdc3a10583a43d/src/lib/builders/tabs/create.ts#L93
Given those constraints I'm not able to customize the shadcn-svelte tabs component using links, as the builder action does a
event.preventDefault()
, resulting in disabling the navigation to thehref
of the link:https://github.com/melt-ui/melt-ui/blob/2863c17ed17d46cb7c0a62fa65bdc3a10583a43d/src/lib/builders/tabs/create.ts#L118
My question
Could the addition of my requirement (utilizing links for tabs) be considered for inclusion in the roadmap, or is there a reason why it's not advisable (e.g. accessibility issues)?
Beta Was this translation helpful? Give feedback.
All reactions