I'm told it depends on whether the control has a value or not. Check and see if you are either setting them to a value programmatically or have your table's column setup with a default value in your database.
On the other hand, in your case it seems to have something to do with being nullable. Still trying to figure this all out myself.
I just noticed this issue for RadzenFormField containing a RadzenNumeric.
If my RadzenNumeric is bound to a nullable numeric type like decimal? then if the value is null and the field is not selected, the field looks different. If I select the field or if it has a non-null value, it turns normal.
" Unfortunately this is an issue that RadzenNumeric inherits from Blazor and .NET - numeric types have a default value which is not an empty string. The problem is not specific only to Radzen itself:
Just want to add that even if RadzenNumeric doesn't show 0 by default the model value would still be 0. It would be impossible to tell if the user entered 0 or didn't enter anything. I believe this is one of the reasons nullable value types exist.
Edit:
I experimented a little more and now I think I understand the confusion. I now suspect the issue I thought was a bug is a feature. The same rendering is done on regular text fields as well.
Un-selected text area with no value
2.Selecting the text area
Un-selected text area with a value
Looks like the selected one but I can't post more pictures in the post.
To me it is strange that the label jumps around, but it seems deliberate now that I dig a bit deeper.
Hello @yordanov, I'm not sure why but implementing this does not change the behavior of any of my FormField components that display floating labels by default when I don't want them to. One example:
RadzenFormField displays a label by default. The new property does not change that. It stops the label from moving when the component is empty. The only purpose of RadzenFormField is to display a label above the input component. If you don't want a label you should not use RadzenFormField.
I got the same problem in Radzen Studio. i add an attribute to use new Property but nothing changes.
Will this "change Theme and then change it back" work for Radzen Studio also?
And will the new Property "AllowFloatingLabel" be integrated in RS?