Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filament forms repeater afterStateUpdated is not called problem #12505

Closed
XarchencoMO opened this issue Apr 26, 2024 · 2 comments
Closed

filament forms repeater afterStateUpdated is not called problem #12505

XarchencoMO opened this issue Apr 26, 2024 · 2 comments
Labels
Milestone

Comments

@XarchencoMO
Copy link

Package

filament/forms

Package Version

v2.17.53

Laravel Version

v9|v10

Livewire Version

v2.12.6

PHP Version

8.2

Problem description

When i calling afterStateUpdated on RepeaterFiled in filament/forms, nothing happens (i used xdebug to keep track of what was happening, but nothing was happening)

Expected behavior

In my opinion, after adding/deleting/moving an object inside the repeater, this method should have been called, perhaps when changing one of the fields inside the form specified in the repeater, it should be called, but here I'm not 100% sure

Steps to reproduce

if you are using docker, you can start my docker compose contrainers
docker compose up -d --build
then you can go inside the "app" container:
'docker compose exec -ti app /bin/sh'
then inside the "app" container:

  • composer i
  • 'cp .env.example .env'
  • 'php artisan key:generate'
  • php artisan migrate

Reproduction repository

https://github.com/XarchencoMO/filament-forms-repeater-problem

Relevant log output

No response

@XarchencoMO XarchencoMO added bug Something isn't working low priority unconfirmed labels Apr 26, 2024
@danharrin danharrin added this to the v3 milestone May 6, 2024
@elasti-co
Copy link

elasti-co commented May 14, 2024

When I try to place in Repeater with relationship() option any field with array casting using dot notation it fails to bind model.

Repeater::make('tasks')
    ->relationship()
    ->schema([
        TextInput::make('content.text')
    ]);

Maybe it is somehow connected with this issue.
Don't know how to solve the problem.
Now upgrading from v2 where it worked fine.

@danharrin danharrin modified the milestones: v3, v2 May 16, 2024
@danharrin
Copy link
Member

Yeah this has been fixed in v3 now, if we did it in v2 it would be a breaking change :)

Repeater::make('tasks')
    ->relationship()
    ->schema([
        Group::make([
            TextInput::make('text'),
        ])->relationship('content'),
    ]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants