mohamedsabil83 / filament-forms-tinyeditor

A TinyMce Editor component for filament
MIT License
164 stars 37 forks source link

[Bug]: Editor in nested repeater breaks after changing the order #88

Closed studiowizjo closed 10 months ago

studiowizjo commented 10 months ago

What happened?

In a situation where the editor is embedded in a nested repeater field that has a sorting option, after changing the order of the elements, the editor breaks (the content in it disappears and the content area becomes inactive - you can't click on it and write). It seems that it is not being re-initialized correctly.

An example of a form configuration that causes this error:

Repeater::make('questions')
    ->label('FAQ categories')
    ->createItemButtonLabel('Add category')
    ->orderable()
    ->collapsible()
    ->schema([
        TextInput::make('category')
            ->required(),

        Repeater::make('questions')
            ->collapsible() 
            ->orderable()
            ->schema([
                TextInput::make('question')
                    ->required(),

                TinyEditor::make('answer')
                    ->required(),
            ])
            ->columns(2)                
    ])
    ->columns(2);

How to reproduce the bug

As above

Package Version

1.5

PHP Version

8.1.13

Laravel Version

9.19

Which operating systems does with happen with?

Windows

Notes

No response

mohamedsabil83 commented 10 months ago

Try updating to the latest version (1.7.5) and force-publish assets.

mohamedsabil83 commented 10 months ago

I'll close this for now. If you still face it, don't hesitate to re-open.

studiowizjo commented 10 months ago

I apologize for the late response - I was on vacation. I can confirm that it works. Thank you =).