button dont work after toggeling the visability

im making component that allows me to edit text and save or cancle the change.
so i have two buttons (cancle and confirm) that i toggle thir visability. but when iturn on the visability i see the buttons but cant press the buttons.
it hapend evry second toggle.

void UEditableValidatedText::SetEditNameButtonsVisible(bool bVisible) const
{
if (ConfirmButton)
{
ConfirmButton->SetVisibility(bVisible ? ESlateVisibility::Visible : ESlateVisibility::Hidden);
}
if (CancelButton)
{
CancelButton->SetVisibility(bVisible ? ESlateVisibility::Visible : ESlateVisibility::Hidden);
}
}

that the toggle visability code.