相关疑难解决方法(0)

Material-Ui TextField 不受 RTL 方向影响

我在我的 React 项目中使用 Material-Ui!

我按照文档中的步骤在我的项目中允许 RTL 并且一切正常!

除了 TextField 组件

LTR方向:

在此处输入图片说明

RTL方向

在此处输入图片说明

就像你看到的一样!问题在于标签仍在左侧(输入文本工作正常)

App.js 文件

import React, {useState} from 'react';


//i18n
import {withTranslation} from "react-i18next";
import './i18n';

//jss
import { create } from 'jss';
import rtl from 'jss-rtl';
import { StylesProvider, jssPreset } from '@material-ui/core/styles';

 // Configure JSS
 const jss = create({ plugins: [...jssPreset().plugins, rtl()] });




  function App(props) {

      // initialize Language
      const {  i18n } = props;
      const [ prefLang, setPrefLang] = useState(i18n.language);
      let theme =createMuiTheme({
        palette …
Run Code Online (Sandbox Code Playgroud)

reactjs material-ui

2
推荐指数
1
解决办法
2872
查看次数

标签 统计

material-ui ×1

reactjs ×1