huntabyte / shadcn-svelte

shadcn/ui, but for Svelte. ✨
https://next.shadcn-svelte.com
MIT License
5.53k stars 341 forks source link

Click events not handled on Button component #1499

Closed alexauvray closed 1 week ago

alexauvray commented 1 week ago

Describe the bug

on:click events are not handled on the Button ui component.

From what I see, the component isn't properly forwarding event handlers through the props.

Reproduction

<Button on:click={handleLogin}/>

Logs

No response

System Info

"@internationalized/date": "^3.5.6",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"autoprefixer": "^10.4.20",
"bits-ui": "1.0.0-next.59",
"clsx": "^2.1.1",
"lucide-svelte": "^0.460.1",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwind-merge": "^2.5.4",
"tailwind-variants": "^0.3.0",
"tailwindcss": "^3.4.9",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.0.0",
"vite": "^5.0.3"

Severity

annoyance

shyakadavis commented 1 week ago

Hello, @alexauvray

Seems you're on Svelte 5. Make sure you're using @shadcn-svelte@next and take notice that events are now written as so

-- on:click
++ onclick