updating the state of custom field
I can' t get the state to update, I've tried this method, as well as just calling
$this->state($updtedState);$this->state($updtedState); without the $component$component. protected function setUp(): void
{
parent::setUp();
$this->live(onBlur: true)
->afterStateUpdated(function (Component $component, ?string $state, ?string $old) {
if ($state !== null) {
$updatedState = $this->performMathOperation($state);
Log::debug($updatedState); //this is the correct value, want to reflect in text input field.
$component->state($updatedState); //input not getting updated.
}
});
} protected function setUp(): void
{
parent::setUp();
$this->live(onBlur: true)
->afterStateUpdated(function (Component $component, ?string $state, ?string $old) {
if ($state !== null) {
$updatedState = $this->performMathOperation($state);
Log::debug($updatedState); //this is the correct value, want to reflect in text input field.
$component->state($updatedState); //input not getting updated.
}
});
}