In detail I have a checkbox and depending on state the field "Name" should not be visible. So I added the #states attribute to it.
But as a result. Nothing happens. Seems only to work with my own custom form elements.