filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.03k stars 2.94k forks source link

Bulk actions firing twice #1687

Closed zepfietje closed 2 years ago

zepfietje commented 2 years ago

Package

filament/tables

Package Version

v2.10.11

Laravel Version

v9.1.0

Livewire Version

v2.10.4

PHP Version

PHP 8.1.2

Bug description

Bulk actions seem to fire twice. Adding ->requiresConfirmation() fixes it and just executes the action once.

Steps to reproduce

  1. Create a bulk action on a table.
  2. Fire the bulk action.
  3. See the action being fired twice.
  4. Add ->requiresConfirmation() to the action.
  5. Fire the bulk action again.
  6. See the action being fired just once.

Relevant log output

No response

HeartlandTechie commented 2 years ago

Could you provide an example of the HTML code for that being generated? I'm wondering if the button type is wrong - you have to set it to type of button otherwise it will act as a submit button . . . which has caused issues like this on my code elsewhere.

zepfietje commented 2 years ago

Ah good one @HeartlandTechie. I've also had issues caused by a wrong button type before. However, in this case it's type="button", so shouldn't be the cause.

danharrin commented 2 years ago

This appears to be a weird bug with our Alpine code - the click handler for the bulk action buttons is being triggered twice.

danharrin commented 2 years ago

Fixed by #1764.