I want the label to occupy enough space to hold the whole its text without truncation. There is a lot of space at the right side of the RadzenStack. But I don't want the field to be stretched by setting AlignItems="AlignItems.Stretch" for the RadzenStack. Tried with various flex, flex-grow, flex-shrink - no success.
Thank you for your responce. Tried already with width, but this is not flexible - the text is set to the field dinamically and can be longer than hardcoded field length. If it would be automatically adjusted to the text't length...
It seems like the label length is restricted somewhere inside the form field styles - I can't find where. If it would not be restricted, then only the external (for the form field) container can determine the fom field's label length, and the label should be stretched to the maximum of the allowed form field's width. It seem like the label plays no role on growing the form field's occupied width, and I can't find why. Perhaps because of the floating effect based on the transformation, or the absolute position of the label after transformation...
Automatically adjusting the FormField's width to the label text's length is not possible. The label is floating and absolute positioned inside the FormField. Even if it was technically possible I would not recommend it as it would lead to visually misaligned forms.
I'd second my answer, you need to set a base width to the FormField, either via width:
We might consider introducing a title attribute to the FormField's text label, so that a tooltip appears with the full label contents in case the label gets truncated.
This refers to both issues - with input field from the first post and with the date picker.
Strangely, that adding flexibility actually restricts the component. )))
Update. No, the truncation is not gone even after removing the "flex: 1". At leas not in all situations. It behaves better after adding "flex-grow: 1", but then it is stretched to the whole length of the form, which is also not suitable. And the truncation is not gone completely even after that. So, for now the better solutions is just to keep labels short, as advised by @yordanov .
Does this mean, it should be avoided to use long labels inside form fields? Because these long labels won't be wrapped to the second line of the label, nor the field would be stretched enough to hold the whole label in one line?