Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mnuaim's avatar
Level 6

Hi everyone, I'm having an issue with FilamentPHP's RichEditor component inside a Wizard form.

In my form, I have a RichEditor component inside different tabs (steps) of the wizard. The editor works fine in the first tab, but when I switch to the second or third tab, the RichEditor doesn't seem to load or function properly. Here's a simplified version of my form structure:

public static function form(Form $form): Form {
    return $form->schema([
        Forms\Components\Wizard::make()
            ->steps([
                Forms\Components\Wizard\Step::make('Step 1')
                    ->schema([
                        Forms\Components\RichEditor::make('description')
                            ->label('Description')
                            ->required(),
                    ]),
                Forms\Components\Wizard\Step::make('Step 2')
                    ->schema([
                        Forms\Components\RichEditor::make('additional_info')
                            ->label('Additional Info')
                            ->required(),
                    ]),
                // Add more steps here...
            ]),
    ]);
}
0 likes
3 replies
LaryAI's avatar
Level 58

The issue you're encountering with the FilamentPHP's RichEditor component inside a Wizard form is likely due to the way the RichEditor initializes itself. When switching between tabs (steps), the RichEditor might not be re-initializing correctly.

To resolve this, you can use the deferLoading method on the RichEditor component to ensure it initializes properly when the tab is activated. Here’s how you can modify your form structure:

public static function form(Form $form): Form {
    return $form->schema([
        Forms\Components\Wizard::make()
            ->steps([
                Forms\Components\Wizard\Step::make('Step 1')
                    ->schema([
                        Forms\Components\RichEditor::make('description')
                            ->label('Description')
                            ->required()
                            ->deferLoading(), // Add this line
                    ]),
                Forms\Components\Wizard\Step::make('Step 2')
                    ->schema([
                        Forms\Components\RichEditor::make('additional_info')
                            ->label('Additional Info')
                            ->required()
                            ->deferLoading(), // Add this line
                    ]),
                // Add more steps here...
            ]),
    ]);
}

The deferLoading method ensures that the RichEditor component initializes only when the tab is activated, which should resolve the issue of the editor not loading or functioning properly in subsequent tabs.

If the problem persists, you might also want to ensure that your FilamentPHP and its dependencies are up to date, as there could be bug fixes or improvements related to this issue in newer versions.

Please or to participate in this conversation.