Define max input sizes for dialog

This commit is contained in:
Paulo Gustavo Veiga 2022-02-08 22:00:02 -08:00
parent b892c25e3c
commit 275f05a41e
2 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import TextField from '@mui/material/TextField';
import { row } from '@wisemapping/mindplot/src/components/widget/ColorPaletteHtml';
import React, { ChangeEvent } from 'react';
import { ErrorInfo } from '../../../classes/client';
@ -13,6 +14,8 @@ type InputProps = {
autoComplete?: string;
fullWidth?: boolean;
disabled?: boolean;
maxLength?: number,
rows?: number
};
const Input = ({
@ -26,6 +29,7 @@ const Input = ({
autoComplete,
fullWidth = true,
disabled = false,
maxLength = 254,
}: InputProps): React.ReactElement => {
const fieldError = error?.fields?.[name];
return (
@ -43,6 +47,7 @@ const Input = ({
margin="dense"
disabled={disabled}
autoComplete={autoComplete}
inputProps={{ maxLength: maxLength }}
/>
);
};

View File

@ -86,6 +86,7 @@ const CreateDialog = ({ onClose }: CreateProps): React.ReactElement => {
onChange={handleOnChange}
error={error}
fullWidth={true}
maxLength={60}
/>
<Input
@ -99,6 +100,7 @@ const CreateDialog = ({ onClose }: CreateProps): React.ReactElement => {
onChange={handleOnChange}
required={false}
fullWidth={true}
rows={3}
/>
</FormControl>
</BaseDialog>