laravel-frontend-presets / tall

A TALL (Tailwind CSS, Alpine.js, Laravel and Livewire) Preset for Laravel
MIT License
2.43k stars 204 forks source link

Add loading state to buttons #17

Closed Wulfheart closed 3 years ago

Wulfheart commented 4 years ago

Closes #16. Adds a loading state to the buttons with no external dependencies.

ryangjchandler commented 4 years ago

Thanks for contributing @Wulfheart! I've modified the description a little so the issue get closed when merged :)

pktharindu commented 4 years ago

Submit buttons are still clickable when loading. Maybe we could also add disabled attribute on wire:loading to prevent multiple submits?

danharrin commented 4 years ago

That's a good call, @pktharindu.

@Wulfheart Should be solvable with wire:loading.attr="disabled" on the buttons.

Wulfheart commented 4 years ago

Thanks for noting it. I will update it.

nasyrov commented 4 years ago

@Wulfheart perhaps it would be good to add 'disabled' attribute to buttons as well

<button wire:loading.attr="disabled">
    Submit
</button>
Wulfheart commented 4 years ago

@nasyrov thanks for your notice. I’m unsure how your proposal is different to the on @DanHarrin made above. I’m still on it. Just a little lack of time. 😅

ryangjchandler commented 4 years ago

Hey @wulfheart, have you had a chance to look at the improvements above?

Wulfheart commented 4 years ago

@ryangjchandler To be honest I forgot about it.

By the way: What are the pros of using livewire for user login?