mohamedsabil83 / filament-forms-tinyeditor

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

[Bug]: Problems using TinyEditor inside Repeater in RelationManager #119

Closed lacehate closed 5 months ago

lacehate commented 5 months ago

What happened?

Can't use TInyEditor inside Repeater in RelationManager modal window.

How to reproduce the bug

Create resource page with relation manager, with modal window form actions. Tried my best to explain

Package Version

1.6

PHP Version

8.0.2

Laravel Version

10.0

Which operating systems does with happen with?

No response

Notes

No response

mohamedsabil83 commented 5 months ago

Can you provide the schema?

lacehate commented 5 months ago

yes sure

public static function getResultBlock(): Component
    {
        $elements = [];
        $titles = [];
        foreach (ProductResource::getTranslatableLocales() as $locale) {
            $titles[] = Tab::make(SpatieLaravelTranslatablePlugin::getLocaleLabel($locale) ?? $locale)
                ->schema([
                    TextInput::make('block_title.' . $locale)
                        ->label(__('filament::resources/pages/form-element.title'))
                        ->columnSpanFull(),
                    TextInput::make('button_link.' . $locale)
                        ->label(__('filament::resources/pages/form-element.button_link'))
                        ->columnSpanFull(),
                    TextInput::make('button_text.' . $locale)
                        ->label(__('filament::resources/pages/form-element.button_text'))
                        ->columnSpan([
                            'sm' => 1,
                        ]),
                ]);
            $elements[] = Tab::make(SpatieLaravelTranslatablePlugin::getLocaleLabel($locale) ?? $locale)
                ->schema([
                    TinyEditor::make('text.' . $locale)
                        ->columnSpanFull()
                        ->label(__('filament::resources/pages/form-element.text')),
                ]);
        }
        return Card::make()
            ->label(__('filament::resources/pages/form-element.ResultBlock'))
            ->statePath('content')
            ->schema([
                FileUpload::make('image_url_chrome')
                    ->label(__('filament::resources/pages/form-element.url_image_chrome'))
                    ->columnSpanFull(),
                FileUpload::make('image_url_safari')
                    ->label(__('filament::resources/pages/form-element.url_image_safari'))
                    ->columnSpanFull(),
                Tabs::make('tabs')
                    ->tabs($titles),
                Repeater::make('data')
                    ->label(__('filament::resources/pages/form-element.result_block'))
                    ->disableItemMovement()
                    ->minItems(1)
                    ->maxItems(3)
                    ->schema([
                        Tabs::make('tabs')
                            ->tabs($elements),
                    ])
                    ->columnSpanFull()
        ]);
    }
mohamedsabil83 commented 5 months ago

Sorry, I just noticed that you are using v1.6. Upgrade to the v1.7.5 and re-publish the assets.

lacehate commented 5 months ago

updated to 1.7.5v and re-published assets but issue persists

codewithdary commented 4 months ago

@lacehate any chance you have found a solution for this issue?

lacehate commented 4 months ago

@lacehate any chance you have found a solution for this issue?

unfortunately no :(