Rich editor not working inside Livewire component
I'm simply following the instructions on this page:
https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component
But MarkdownEditor and RichEditor don't work on my Livewire components.
What do you think I'm missing?
18 Replies
Did you use $this->form->fill() in your mount method.?
Yes
I tried both doing the instructions step by step, and just simply using the make:livewire-form command which should generate everything for you.
Are you seeing any console errors? Are you using panels or the stand alone form’s pancake
I might be wrong but I feel like it has to do with
ax-load
not working.
No errors in the console, but I started writing richEditor... in the console and didn't get completion, that's why I think the lib is not properly loaded.
I'm using the whole filament package, but this is inside a simple livewire component, not a panelWhat isn’t working about them?
i just see a toolbar, no body, and the toolbar doesn't respond either
and when i submit, the value is null obv
Then I would expect there to be console errors in the dev tools.
Yup, that's strange. I'm creating a reproduction repo.
If you can share some code it might not be needed. I would think that if either of those had bugs it would have been reported already.
Ye I'm sure im missing something, but i just followed the docs
GitHub
GitHub - mokhosh/filament-form-in-livewire: temp reproduction repo
temp reproduction repo. Contribute to mokhosh/filament-form-in-livewire development by creating an account on GitHub.
just created a new laravel app, required filament, used the documentation command, and added rich editor, that's all
the component is rendered on the welcome page
i did steps in single commits so you can track if necessary
Looks like you installed the full filament suite but you are trying to use it as standalone. So, since you aren’t using the panels you are missing the necessary directives to load the styles and scripts in your welcome view.
Or use the panels.
Thanks so much, that fixed the unresponsiveness.
Two questions however,
1. The input has some style issues, like I have the focus outline on it which isn't there in the panel forms
2. Shouldn't this be added to the "Adding forms to livewire components" page in the docs?
i resolved 1
It’s all under the installation guide for each individual package.
But since you installed the full suite all of those steps are handled by the theme install command. But since you are using them standalone you have to follow those package docs. Minus the composer require part since you already installed them all.
That's what I'm saying 😄 All this is not super clear. I think we can make it more clear in the "adding forms to a livewire component" page, that if you're using it this way, you need to take additional steps.
Thank you very much for taking the time and answering anyway. Really appreciate it.