afterStateUpdated() function does not work when hidden() is true

Toggle::make('kismi_teklife_acik_mi')
->live()
->requiredWith('kisim_sayisi')
->inline(false)
->afterStateUpdated(function (Get $get, Set $set) {
if (($get('kismi_teklife_acik_mi') == false)) {
$set('kisim_sayisi', null);
}
})
->label('İhale Kısmi Teklife Açık Mı?'),

TextInput::make('kisim_sayisi')
->label('Kısım Sayısı')
->requiredWith('kismi_teklife_acik_mi')
->numeric()
->validationAttribute('Kısım Sayısı')
->hidden(
fn (Get $get): bool => !$get('kismi_teklife_acik_mi')
),

Hello, I want to empty the kisim_sayisi field when the kismi_teklife_acik_mi field is closed. If it is visible, it works, but if it is not visible, it does not assign null. In short, afterStateUpdated() does not work when hidden() is true.
Was this page helpful?