Skip to content

[Bug]: In the repeater, all localization fields refer to the first repeat-1 field #17

@ColaSquad

Description

@ColaSquad

What happened?

When trying to use TranslatableTabs in a Repeater, all localization fields refer to the first repeat-1 element.

Is there any way to solve this problem?

return $form
            ->schema([
                TextInput::make('name')
                    ->required(),
                    
                TextInput::make('handle')
                    ->required()
                    ->unique(ignoreRecord: true),

                Repeater::make('items')
                    ->relationship('items')
                    ->orderable('order')
                    ->collapsed()
                    ->label('Menu Items')
                    ->schema([
                        TranslatableTabs::make()
                            ->localeTabSchema(fn(TranslatableTab $tab) => [
                                TextInput::make($tab->makeName('title'))
                                    ->label('Title')
                                    ->required()
                                    ->maxLength(255)
                                    ->live(onBlur: true),
                            ]),
                        TextInput::make('url')->required(),
                        Toggle::make('visible')->default(true),
                        Select::make('target')
                            ->options([
                                '_self' => 'Self',
                                '_blank' => 'Blank',
                                '_parent' => 'Parent',
                                '_top' => 'Top',
                            ])
                            ->default('_self'),
                    ]),
            ]);

How to reproduce the bug

Use translations in the repeater as in the code above

Package Version

0.4.0

PHP Version

8.2

Laravel Version

11.31

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