Consignr
Consignr
FFilament
Created by Consignr on 11/14/2023 in #❓┊help
afterStateUpdated() not running on custom component
Hi, not yet...hopefully take another look at the weekend. Maybe there is a better approach to achieve an accordian style component...idk?
6 replies
FFilament
Created by Consignr on 11/14/2023 in #❓┊help
afterStateUpdated() not running on custom component
Any guidance would be really appreciated😬
6 replies
FFilament
Created by Consignr on 11/14/2023 in #❓┊help
afterStateUpdated() not running on custom component
The component class is basically just the default section component with 3 extra methods for the checkbox.
/**
* @param Component | Closure $component
*/
public function checkbox(Component | Closure $component): static
{
$this->checkboxComponent = $component;

return $this;
}

/**
* @return Component
*/
public function getCheckboxComponent()
{
return $this->evaluate($this->checkboxComponent);
}

/**
* @return Component
*/
public function getCheckboxComponentContainer(): ComponentContainer
{
return ComponentContainer::make($this->getLivewire())
->parentComponent($this)
->components([$this->getCheckboxComponent()]);
}
/**
* @param Component | Closure $component
*/
public function checkbox(Component | Closure $component): static
{
$this->checkboxComponent = $component;

return $this;
}

/**
* @return Component
*/
public function getCheckboxComponent()
{
return $this->evaluate($this->checkboxComponent);
}

/**
* @return Component
*/
public function getCheckboxComponentContainer(): ComponentContainer
{
return ComponentContainer::make($this->getLivewire())
->parentComponent($this)
->components([$this->getCheckboxComponent()]);
}
The checkbox is rendered in the view
{{ $getCheckboxComponentContainer() }}
{{ $getCheckboxComponentContainer() }}
The CheckboxSection components work as expected except for the afterStateUpdated method on the checkbox. https://www.awesomescreenshot.com/video/22464078?key=51b79342d2ce9e5703bced135c554ca2
6 replies