mohamedsabil83 / filament-forms-tinyeditor

A TinyMce Editor component for filament
MIT License
174 stars 39 forks source link

[Bug]: No dark mode error #94

Closed makzumi closed 1 year ago

makzumi commented 1 year ago

What happened?

When disabling dark mode in a panel, the editor does not load since it can't find a default value for "theme", it should default to "light".

File: vendor/mohamedsabil83/filament-forms-tinyeditor/resources/views/tiny-editor.blade.php Line: 24

image

How to reproduce the bug

Disable dark mode and it will fail loading:

public function panel(Panel $panel): Panel { return $panel ->default() ... ->darkMode(false) ... }

Package Version

2

PHP Version

8.1

Laravel Version

10

Which operating systems does with happen with?

No response

Notes

No response

makzumi commented 1 year ago

If anyone else is facing this issue, this is my workaround: Inject the variable inside a HtmlString.

TinyEditor::make('content')
    ->helperText(fn()=>new HtmlString('<script>window.theme="light"</script>'))
    ->columnSpan(1)
    ->columnSpanFull(),
mohamedsabil83 commented 1 year ago

Thank you for mentioning that. Fix in v2.0.2