© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
9 replies
Wirkhof

Password confirmation not refreshed

I have this code:

Checkbox::make('password_change_checkbox')
    ->label('Change your password')
    ->visibleOn('edit')
    ->live(),

TextInput::make('password')
    ->dehydrated(fn(Get $get): bool => $get('password') != '')
    ->live()
    ->afterStateUpdated(
        function (
          Forms\Contracts\HasForms $livewire, 
          Forms\Components\TextInput $component
        ) {
          $livewire->validateOnly($component->getStatePath());
    })
    ->confirmed()
    ->required()
    ->label('Password') 
    ->visibleOn('edit')
    ->hidden(fn(Get $get): bool => !$get('password_change_checkbox')),

TextInput::make('password_confirmation')
    ->dehydrated(false)
    ->live()
    ->afterStateUpdated(
        function (
          Forms\Contracts\HasForms $livewire, 
          Forms\Components\TextInput $component
        ) {
          $livewire->validateOnly($component->getStatePath());
    })
    ->required()
    ->label('Repeat password') 
    ->visibleOn('edit')
    ->hidden(fn(Get $get): bool => !$get('password_change_checkbox'))
Checkbox::make('password_change_checkbox')
    ->label('Change your password')
    ->visibleOn('edit')
    ->live(),

TextInput::make('password')
    ->dehydrated(fn(Get $get): bool => $get('password') != '')
    ->live()
    ->afterStateUpdated(
        function (
          Forms\Contracts\HasForms $livewire, 
          Forms\Components\TextInput $component
        ) {
          $livewire->validateOnly($component->getStatePath());
    })
    ->confirmed()
    ->required()
    ->label('Password') 
    ->visibleOn('edit')
    ->hidden(fn(Get $get): bool => !$get('password_change_checkbox')),

TextInput::make('password_confirmation')
    ->dehydrated(false)
    ->live()
    ->afterStateUpdated(
        function (
          Forms\Contracts\HasForms $livewire, 
          Forms\Components\TextInput $component
        ) {
          $livewire->validateOnly($component->getStatePath());
    })
    ->required()
    ->label('Repeat password') 
    ->visibleOn('edit')
    ->hidden(fn(Get $get): bool => !$get('password_change_checkbox'))


The checkbox toggle works, I am putting it here just for context, in case it has something to do with my issue.

The issue is that the realtime password validation doesn't work if I start with the password field and type ie. "mypassword" and tab or click in the password_confirmation field and type again "mypassword".

I haven't put the ->password() on any of those fields, so I see those are identical.

But the error message under the password field doesn't go away for some reason.

I can Save the form and the newly typed password will be correctly saved despite the error message suggesting otherwise.

Funnily it works when I start first with the password_confirmation field and shift+tab or click into the previous password field and then the message disappear.

Any idea how to make the password confirmation error message disappear when doing real time validation?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Password Confirmation for Edit Profile page
FilamentFFilament / ❓┊help
3y ago
Did not receive email confirmation
FilamentFFilament / ❓┊help
3y ago
How can I add a password confirmation to any action
FilamentFFilament / ❓┊help
3y ago
Delete Confirmation
FilamentFFilament / ❓┊help
3y ago