rawilk / laravel-form-components

Form components built for Tailwind & Livewire.
https://randallwilk.dev/docs/laravel-form-components
MIT License
396 stars 44 forks source link

Livewire Reset Form - Custom Select #135

Open joserick opened 1 year ago

joserick commented 1 year ago

Laravel Form Components Version

V8.1.4

Laravel Version

v10.21.0

Alpine Version

v3.13.0

Bug description

Hi,

I have a Livewire component which renders a view through a "Modal" where a "Custom Select" is located, this works correctly, but when I send the form, I execute the Livewire "Reset" method, which correctly cleans the form except the "Custom Select", this does not clean the select when the value is empy.

Component Livewire:

   public string $name = "";
   // ...
    public function addNewElement() : void {
        $this->reset('name');
        // $this->show_modal = false;
    }

View:

<x-form-group :label="__('Name')" name="name">
    <x-custom-select name="name" wire:model="name" optional
        :options="$elements" :placeholder="__('Select a element')" required/>
</x-form-group>

Steps to reproduce

No response

Relevant log output

No response

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.