fix(web): fix otp input box with themes (#1723)
#1584 introduced a regression due to the way layouts are addressed with [CSS normalization](https://material-ui.com/components/css-baseline/#layout). This PR ensures that the OTP input box will remain a `content-box` to avoid any text display and box sizing issues caused by padding. The OTP input has also been changed to only accept numbers. Fixes #1720.pull/1725/head
parent
361705738a
commit
2502b40cd6
|
@ -27,6 +27,7 @@ const OTPDial = function (props: Props) {
|
||||||
value={props.passcode}
|
value={props.passcode}
|
||||||
numInputs={6}
|
numInputs={6}
|
||||||
isDisabled={props.state === State.InProgress || props.state === State.Success}
|
isDisabled={props.state === State.InProgress || props.state === State.Success}
|
||||||
|
isInputNum
|
||||||
hasErrored={props.state === State.Failure}
|
hasErrored={props.state === State.Failure}
|
||||||
inputStyle={classnames(style.otpDigitInput, props.state === State.Failure ? style.inputError : "")}
|
inputStyle={classnames(style.otpDigitInput, props.state === State.Failure ? style.inputError : "")}
|
||||||
/>
|
/>
|
||||||
|
@ -48,6 +49,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
marginTop: theme.spacing(2),
|
marginTop: theme.spacing(2),
|
||||||
},
|
},
|
||||||
otpDigitInput: {
|
otpDigitInput: {
|
||||||
|
boxSizing: "content-box",
|
||||||
padding: theme.spacing(),
|
padding: theme.spacing(),
|
||||||
marginLeft: theme.spacing(0.5),
|
marginLeft: theme.spacing(0.5),
|
||||||
marginRight: theme.spacing(0.5),
|
marginRight: theme.spacing(0.5),
|
||||||
|
|
Loading…
Reference in New Issue