【发布时间】:2021-02-23 21:57:25
【问题描述】:
我有一个 Material UI 电话号码,当我的网站显示为 RTL 时,电话号码会自动对齐到右侧,但号码也会变得混乱。如何确保号码保持原样?
<div open={this.props.open} onClose={this.props.onClose} dir="rtl">
<DialogTitle title="New User" />
This text will be RTL led !
<div>
<Typography component="label">'Phone Number'</Typography>
<MuiPhoneNumber
name="phone"
data-cy="user-phone"
defaultCountry={"us"}
value={this.state.phone}
value="1(937)-123-4567"
onChange={this.handlePhoneChange}
/>
<p>614-764-6300</p>{" "}
{/* number is right aligned but number stays the same which is how it should be*/}
</div>
</div>
这里是codeandbox链接https://codesandbox.io/s/mui-phone-number-forked-cczzj?file=/src/CreateUserDialog.js
【问题讨论】: