Skip to content

[Bug]: Fields in withFields() not submitting on form submission since v4 #49

@Bjornftw

Description

@Bjornftw

What happened?

Since upgrading to version 4, fields configured with ->withFields() are no longer submitted when creating a record. The autocomplete populates the fields correctly in the form, but when clicking "Create", these fields arrive empty in the request.

How to reproduce the bug

  1. Install package version 4.x in a Filament project
  2. Add a GoogleAutocomplete field with mapped fields:
GoogleAutocomplete::make('google_search')
  ->label('Google Maps')
  ->language('nl')
  ->countries([
    'NL',
  ])
  ->withFields([
    TextInput::make('name')
      ->extraInputAttributes([
        'data-google-field' => '{name}',
      ])
      ->live()
      ->afterStateUpdated(function (Get $get, Set $set) {
          $set('slug', Str::slug($get('name')));
      }),
  ])
  1. Create a new record and use the Google Maps field to search for a location
  2. Select a location from the dropdown - observe that the 'name' field populates correctly
  3. Click "Create" to submit the form
  4. Inspect the request or check database - the 'name' field mapped in withFields() is empty/null while the 'google_search' field has the correct value

Package Version

v4.0.2

PHP Version

8.4.7

Laravel Version

12.25.0

Which operating systems does with happen with?

Linux

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions