Skip to content

Commit

Permalink
fix(numberTextField): fix overriding of inputProps
Browse files Browse the repository at this point in the history
  • Loading branch information
Clm-Roig committed Jun 7, 2022
1 parent bc5a1cd commit 85fde7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/forms/NumberTextField/NumberTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import { TextField, TextFieldProps } from '@mui/material';
import { FC } from 'react';

const NumberTextField: FC<TextFieldProps> = (textFieldProps) => {
const { inputProps, ...otherProps } = textFieldProps;
return (
<TextField
inputProps={{
inputMode: 'numeric',
min: 1,
pattern: '[0-9]*',
type: 'number'
type: 'number',
...inputProps
}}
{...textFieldProps}
{...otherProps}
/>
);
};
Expand Down

0 comments on commit 85fde7a

Please sign in to comment.