I found the problem. It is with the ShadcnUI lib. The element works in different ways that I don't have the explanation. But making a Button that changes the value "tipo" works normally.