litstack icon indicating copy to clipboard operation
litstack copied to clipboard

Bug: $form-group() in repeatable

Open albertpratomo opened this issue 4 years ago • 4 comments

$form->group() seems to not work properly inside repeatable. The following config results in 2 title and 2 body fields rendered, while it should be only 1.

$form->block('image_cards')
            ->repeatables(function ($repeatables) {
                $repeatables->add('card', function ($form, $preview) {
                    $preview->col('{title}');

                    $form->group(function ($form) {
                        $form->input('title');

                        $form->textarea('body');
                    })->width(8);

                    $form->image('image')->maxFiles(1)->translatable()
                        ->showFullImage()->width(4);
                });
            })

image

albertpratomo avatar Dec 09 '20 11:12 albertpratomo

It seems this is also problematic:

$form->group(....)->when(...)->orWhen(...);

The when conditions are not respected, the group is always rendered..

albertpratomo avatar Dec 10 '20 11:12 albertpratomo

Will have a look on this 🤔

cbl avatar Dec 10 '20 11:12 cbl

@cbl Is the bug confirmed?

albertpratomo avatar Dec 12 '20 18:12 albertpratomo

This field duplication also occurs when trying to use a group inside a (BaseForm) macro.

lpheller avatar Feb 12 '21 15:02 lpheller