首页 > 解决方案 > React Material-UI 文本字段填充顶部 - 泰语

问题描述

我正在使用该库进行输入。但是当与泰语一起使用时,它需要额外的顶部填充才能正确显示单词,因为泰语有 2 级元音。例如,“ที่นั่น”之类的单词将在顶部被剪切。下面是我使用的代码。

      <Grid item xs={12} md={10}>
        <TextField required id="name" label="Remark name" fullWidth />
      </Grid>

当我在 Textfield 中输入单词“ที่นั่น”时,只会显示这个。我尝试了各种风格来改变这一点,但没有成功。

截屏运行代码

标签: reactjsmaterial-uitextfieldthai

解决方案


感谢您的所有评论。就我而言,我发现我需要将 paddingTop 放在 InputProps 中。所以,我使用的代码是:

const styles = theme => ({
  thaiTextFieldInputProps:{
    paddingTop: '5px'
  },
});

进而

<TextField
   InputProps={{
      classes: {
         input: classes.thaiTextFieldInputProps
      }
   }}
   label="Thai Remark"
   fullWidth
/>

推荐阅读