[英]Keep MUI TextField label on top when text field has no value
So this should be simple but I don't see a clear answer.所以这应该很简单,但我没有看到明确的答案。 The labels I have looks like this:
我的标签是这样的:
As you can see the bottom 2 fields have the label on top since they have a default value whereas the top on "ML Features" does not and the label moves to the middle of the TextField
.如您所见,底部的 2 个字段在顶部有 label,因为它们具有默认值,而“ML 功能”的顶部没有,并且 label 移动到
TextField
的中间。
The code looks like this:代码如下所示:
<TextField
label="ML Features" // or any other field
...
>
</TextField>
How can I keep the label always on the top?我怎样才能让 label 一直在最前面?
you need to add focused so that it will be in top without any value您需要添加重点,以便它在没有任何价值的情况下排在首位
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.