Custom field Open Modal Form
I create a custom field
`
Button render correct but modal not open? I use this button on a form
6 Replies
It's hard to tell since you didn't provide your blade code. Also check for console errors.
My field code is very simple.
No error from browser console.
Ah you are using the new actions. Not sure whether that's supported in fields. They are no LW components.
Ok, what is best to have a field that I can reuse and have a button that open a modal. A view, and a LW component?
I am not 100% sure. Instead of a field you could just use class with a static method, that returns a field. You can use the Actions form field an put a action in there.
OK, thanks
I create a filament page for testing, and create a LW component like this:
and this blade render LW component
```<div>
{{$this->editAction}}
<x-filament-actions::modals />
</div>```
Button is rendered but modal not open.
Browser console say:
(el2) => {
if (isntElement(el2))
return;
return el2.hasAttribute(
wire:key) ? el2.getAttribute(
wire:key) : el2.hasAttribute(
wire:id) ? el2.getAttribute(
wire:id`) : el2…
Thanks