© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Jon Mason

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.
                }
            });
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Disabled field through $set function not updating state
FilamentFFilament / ❓┊help
3y ago
State not updating
FilamentFFilament / ❓┊help
2y ago
how to update state in custom field?
FilamentFFilament / ❓┊help
14mo ago
load and store state in custom field
FilamentFFilament / ❓┊help
2y ago