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.3k stars 2.96k forks source link

Modal button order (primary action vs cancel action) is not consistent across action types #9838

Closed ryanmortier closed 11 months ago

ryanmortier commented 12 months ago

Package

filament/filament

Package Version

v3

Laravel Version

v10

Livewire Version

v3

PHP Version

v8.2

Problem description

edit: I've managed to work-around the issue with the following:

Tables\Actions\DeleteAction::make()
    ->modalSubmitAction(fn (StaticAction $action) =>
        $action->extraAttributes(['class' => 'order-first'])),

In a create modal, the button order is primary -> secondary In an edit modal, the button order is primary -> secondary In a delete confirmation modal, the button order is secondary -> primary

I believe this to be a UX issue and could cause a user to misclick an action if not paying attention.

Also, I don't think I can fix this in CSS because fixing it for one modal, reverses it on the other.

Best described in screenshots:

Create: CleanShot 2023-11-23 at 21 45 14

Edit: CleanShot 2023-11-23 at 21 45 26

Delete: CleanShot 2023-11-23 at 21 45 37

Expected behavior

Primary button orders should be consistent across all modals for UX.

Steps to reproduce

Open create/edit/delete modals in the Filament demo app.

Reproduction repository

https://github.com/filamentphp/demo

Relevant log output

No response

danharrin commented 11 months ago

This is to do with if the actions are full width or not. You can observe the same in Tailwind UI:

Screenshot 2023-11-27 at 23 13 49 Screenshot 2023-11-27 at 23 13 43

If you align the actions to the right, they swap position, like Tailwind UI:

Screenshot 2023-11-27 at 23 14 27