Open ncvc opened 1 month ago
Is adding id
prop the solution?
That would fix my specific issue, but I think users will expect all the props to be passed into the svelte:element tag when the button is disabled, since that's the behavior when it's not disabled.
Why did restProps
need to be removed here? https://github.com/themesberg/flowbite-svelte/commit/11d5308785db59c70b58ad19a9819a5bbaacbc3e#diff-bb40d1bd5fefb1ab555586115b3092620c9b98dc5ddf6f33115899c19f4c442eR130
By adding ...$$restProps
, you are allowing on:click
event that trigger the event even if you have disabled
attribute.
Gotcha - what if we do something like this? https://github.com/themesberg/flowbite-svelte/pull/1339
Just opened the PR to show the change, I haven't tested it since I don't have the local dev environment for this setup. Feel free to take over / edit that PR or close it and open your own
Describe the bug
The fix to this issue (commit here) introduced a bug - the
id
prop is no longer passed to thebutton
tag when theButton
isdisabled
because$$restProps
is no longer being passed tosvelte:element
when the Button is disabled. For us, this means that we can't target a button by id with a tooltip when that button is disabled.Reproduction
Flowbite version and System Info