daisyui / react-daisyui

daisyUI components built with React 🌼
http://react.daisyui.com/
MIT License
955 stars 103 forks source link

Button loading prop does not work when startIcon is set #389

Closed jisensee closed 1 year ago

jisensee commented 1 year ago

Basically title. When a button has a startIcon set and loading = true, neither the loading indicator nor the icon are displayed. The bug is directly in the button implementation as far as I can tell: https://github.com/daisyui/react-daisyui/blob/fba1e1b68874b5c80c52c611a3a8bdc2ab6e5464/src/Button/Button.tsx#L165 The loading indicator will never be shown when a startIcon is set. However, previously (before the last major update) it would replace the startIcon. So this condition just has to lose the !startIcon part I think.

benjitrosch commented 1 year ago

@jisensee thanks for finding this. You're right, removing the !startIcon condition would fix this. Do you want to submit the PR?

benjitrosch commented 1 year ago

Fixed with ecb4add