reactjs - material ui: how to align the Input Label properly
问题描述
I have the following code for input with inputlable
<FormControl>
<InputLabel htmlFor="my-input">
Photo
</InputLabel>
<input
type="file"
/>
</FormControl>
What I see is
What I want is
I get this using:
<TextField
fullWidth
label="photo"
margin="dense"
accept="image/*"
type="file"
InputLabelProps={{
shrink: true,
}}
/>
So how can get this same effect using the previous code i.e using formcontrol, inputlable etc.
The reason i have to use that intead of textfield is react hook form: materail ui: Textfield: onSubmit, not passing Filelist in the data
解决方案
推荐阅读
- tflearn - 如何使用 tflearn.data_utils.to_categorical (y, nb_classes)
- php - 无法使用 php 更新 Cookie
- haskell - 我不明白列表减法中的类型类约束
- hive - Hortonworks:Hbase、Hive 等用于哪种类型的数据
- css - Handlebars+BootStrap 卡片边框
- git - Git远程推送后打印一条多色消息
- c - 使用命令行参数将数据从我的第二个 txt 文件传输到我的第二个字符数组时出现问题
- node.js - Nuxt js页面显示404 not found
- sql - SQL 选择按查询排序的列
- java - Java“找不到符号”错误