cheesegrits / filament-google-maps

Google Maps package for Filament PHP
246 stars 68 forks source link

Geocomplete field updated event #46

Open KonradHambuch opened 1 year ago

KonradHambuch commented 1 year ago

Geocomplete field updated event only fires when typing but not when selecting from the list.

I would like to use real-time validation on that field when someone chooses from the dropdown like this:

    public function updated($propertyName)
    { 
        $this->validateOnly($propertyName);        
    }

And the rule of the field:

            ->live()
            ->rules([
                function () {
                    return function (string $attribute, $value, Closure $fail) {
                        if ($fail) {
                            $fail('failed');
                        }
                    };
                },        
            ])

Just like in case of the Select field, which fires afterStateUpdated when selected from the dropdown.

cheesegrits commented 1 year ago

I'm looking at this now. I thought I'd already added some code to handle this, but apparently not.