arnaudsf
arnaudsf
FFilament
Created by arnaudsf on 4/14/2025 in #❓┊help
Close multiselect
Currently, to close a multiselect component, the user must click outside the input field. While this interaction is manageable on desktop—where users can easily click outside the input—it becomes less intuitive on mobile devices, particularly on Android. On mobile, users often notice the dropdown arrow but tapping it does not close the multiselect. This results in confusion and a poor user experience, as there is no clear visual cue or gesture to dismiss the options list. Question: Has anyone encountered and resolved this usability issue without overriding the Blade template? I am specifically looking for a solution that enhances the mobile experience without the need to rewrite the component's view.
5 replies
FFilament
Created by arnaudsf on 2/12/2025 in #❓┊help
Closure on select options strange behavior
Hello, I don't know how to explain it properly but I have an header table action in my RelationManager. Inside I have a form with a select. If in the options of the select I pass an array :
->options([4 => 'Test'])
->options([4 => 'Test'])
Or
->options(Product::where(...)->toArray())
->options(Product::where(...)->toArray())
Then I submit the form, it saves and refresh the table. BUT If I pass a closure to the options field, like :
->options(fn(Get $get) => Product::where(...))
->options(fn(Get $get) => Product::where(...))
Even without change my query, the table won't refresh. Any idea ?
3 replies
FFilament
Created by arnaudsf on 1/14/2025 in #❓┊help
Submit deferred filters in a modal on enter key press
Hi, does anyone know how to submit a deferred filter form located inside a modal when pressing the Enter key on the keyboard?
5 replies
FFilament
Created by arnaudsf on 12/9/2024 in #❓┊help
test select action inside modal
In my LeadResource, on the ListRecord page, I have a "Create" action that opens a form modal to create a new lead. The form includes a select field with an action to create a new customer on the fly. When the user creates a customer, the customer ID should be associated with the new lead. I'm trying to write a test to verify: - 1/ The new customer is created successfully. - 2/ The ID of the newly created customer matches the one associated with the newly created lead. Here’s what I have so far for testing the lead creation:
it('can create a record', function () {
$lead = $this->organization->leads()->get()->random();

$customer = $lead->customers()->with('contacts')->first();

livewire(ListLeads::class)
->callAction('create', data: [
'owner_id' => $lead->owner->id,
'status_id' => $lead->status_id,
...
])
->assertHasNoActionErrors();
});
it('can create a record', function () {
$lead = $this->organization->leads()->get()->random();

$customer = $lead->customers()->with('contacts')->first();

livewire(ListLeads::class)
->callAction('create', data: [
'owner_id' => $lead->owner->id,
'status_id' => $lead->status_id,
...
])
->assertHasNoActionErrors();
});
Now, I want to test the nested action for creating a customer. I’ve attempted this:
livewire(ListLeads::class)
->callAction('create')
->mountFormComponentAction('mountedActionsData.0.customer_id', 'createCustomer')
->assertFormComponentActionDataSet([
'contact.first_name' => $firstName,
'contact.last_name' => fake()->lastName(),
'contact.zipcode' => fake()->postcode(),
'contact.city' => fake()->city(),
'contact.country' => 'FR',
])
->callMountedFormComponentAction()
->assertHasNoFormComponentActionErrors();
livewire(ListLeads::class)
->callAction('create')
->mountFormComponentAction('mountedActionsData.0.customer_id', 'createCustomer')
->assertFormComponentActionDataSet([
'contact.first_name' => $firstName,
'contact.last_name' => fake()->lastName(),
'contact.zipcode' => fake()->postcode(),
'contact.city' => fake()->city(),
'contact.country' => 'FR',
])
->callMountedFormComponentAction()
->assertHasNoFormComponentActionErrors();
` However, I’m struggling with the following: - 1/ How to properly test the createCustomer action within the context of the "Create" action? - 2/ How to assert that the new customer's ID is correctly associated with the newly created lead? Any suggestions or examples for testing nested actions in Livewire? Thanks in advance for your help!
3 replies