mask with afterStateUpdated immediately submits form

Why does using the mask() method as well as the afterStateUpdated method on a TextInput make the form immediately submit?

 TextInput::make('total')
                    ->mask('999999')
                    ->afterStateUpdated(function (?string $state, ?string $old) {
                        Log::debug($state);
                      
                    }),


Using either one by itself works as expected.
Was this page helpful?