TinyMce in filamentphp as a customField
I want to use TinyMCE in my form builder, but I can't. When I use the script inside my custom view, TinyMCE loads, but it disappears when I use a reactive() or any real-time functionality like a wizard. Additionally, when I hit "create", it won't send the data and I get the error "title cannot be null".
I also tried registering the TinyMCE script file as the Filament documentation suggests (https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files). I can see the script file when I inspect the page, but TinyMCE won't load.
Here's my custom-textarea.blade.php file:
And this is my form function:
13 Replies
Okay guys I have been successfull on prventing it to disapear with "wire:ignore" but still get the error "title cannot be null".
this is the updated textarea
I've been doing some research on this, but I haven't been able to come up with any solution. Might be worth taking the issue to either the creators or to the official filament server. Might be a good idea for a plugin. I'm sorry I can't be of more help
I think there is already a plugin:
https://github.com/mohamedsabil83/filament-forms-tinyeditor
GitHub
GitHub - mohamedsabil83/filament-forms-tinyeditor: A TinyMce Editor...
A TinyMce Editor component for filament. Contribute to mohamedsabil83/filament-forms-tinyeditor development by creating an account on GitHub.
@samnaghavi Give this plugin a whirl and let us know if it works for you
Thanks for all who answerd my question. I Already tried this package before. the problem is it does not have all the features of TinyMce. that is why I was trying to use it as a custom field.
you can compare it in these 2 photos
I believe there might be a JavaScript or Livewire code solution to resolve my issue. The problem I'm experiencing is that when using TinyMCE, the data doesn't populate the <textarea></textarea> "I believe that is how tinyMce works but filament cant understand it and returns null" . As a temporary workaround, I've added another <textarea> below my custom TinyMCE field. After finishing editing my blog in TinyMCE, I click on the 'View Source' button (a TinyMCE feature that displays the HTML source of the edited text) and copy the entire HTML. Then, I paste it into the other textarea and proceed to upload the content😂 .
this is my code now.
Maybe you can try to fork the plugin and edit the options in the package. I haven't any experience with that. Maybe you contact the owner of the plugin.
alright I try and contact him to see if we can come up with something it would be an amazing adition to filamentphp
If it's ok with everyone involved. I'll mark this as solved since there's no more work to be done.
I got in contact with the creator of the package and he said he is waiting for the stable version so he can update his package so it supports current version of tinyMCE
I think thats the best solution.
I concur