3rgo
3rgo
FFilament
Created by 3rgo on 11/21/2023 in #❓┊help
Disabled action tooltip does not show
I'm working on a form (inside a custom page FWIW) with an action that is disabled dynamically depending on the form state. I would like to show a tooltip only when my action is disabled, to inform the user of why it is disabled, so I've injected the state of the current action to vary my tooltip content :
Action::make(__('pages.apply.submit'))
->icon('fas-paper-plane')
->color('success')
->disabled(fn ($livewire) => $livewire->isDirty())
->tooltip(fn (Action $action) => $action->isDisabled() ? __('pages.apply.submit_confirmation_disabled') : null)
Action::make(__('pages.apply.submit'))
->icon('fas-paper-plane')
->color('success')
->disabled(fn ($livewire) => $livewire->isDirty())
->tooltip(fn (Action $action) => $action->isDisabled() ? __('pages.apply.submit_confirmation_disabled') : null)
But when the action is disabled the tooltip does not show. If I remove the condition and set the tooltip text unconditionally, it show when the action is enabled and does not show when the action is disabled. Did I do something wrong, or is this expected behavior ? If this is expected, is there a workaround ? Thanks
2 replies
FFilament
Created by 3rgo on 11/17/2023 in #❓┊help
Ability to skip validation on form ?
Hey everyone ! I'm working on a custom page that contains a form. I need to have 2 actions at the bottom : - a "save draft" action that performs the model update (even a partial one, ignoring empty fields), so ignoring the required rule - a "submit" action that performs a total data validation and save My save draft action is not on a submit button, but a regular one, with wire:click="saveDraft" , but I never reach the dd in that function, and validation fails on empty fields. Any idea how I can go around the required rule when using this method ? Thanks !
9 replies
FFilament
Created by 3rgo on 9/13/2023 in #❓┊help
Custom widget collapsible section does not work
I'm building a custom widget to display in a form header, and I'm using the x-filament::section helper from the core documentation (https://filamentphp.com/docs/3.x/support/blade-components/section), and the collapsibleflag does not seem to work, I get the following AlpineJS error :
Alpine Expression Error: isCollapsed is not defined Expression: "{ 'invisible h-0 border-none': isCollapsed }"
Here is my code, I didn't do anything too fancy yet :
<x-filament-widgets::widget>
<x-filament::section icon="fas-calendar-check" collapsible>
<x-slot name="heading">
{{ __('attributes.attributions') }}
</x-slot>

{{-- Content --}}
Test
</x-filament::section>
</x-filament-widgets::widget>
<x-filament-widgets::widget>
<x-filament::section icon="fas-calendar-check" collapsible>
<x-slot name="heading">
{{ __('attributes.attributions') }}
</x-slot>

{{-- Content --}}
Test
</x-filament::section>
</x-filament-widgets::widget>
When I check the HTML code, the x-data directive is present on the section root element with the boolean in it, I don't know what went wrong Everything is up to date on Composer and NPM (did the v3 upgrade earlier today)
12 replies