mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Define max input sizes for dialog
This commit is contained in:
parent
b892c25e3c
commit
275f05a41e
@ -1,4 +1,5 @@
|
|||||||
import TextField from '@mui/material/TextField';
|
import TextField from '@mui/material/TextField';
|
||||||
|
import { row } from '@wisemapping/mindplot/src/components/widget/ColorPaletteHtml';
|
||||||
import React, { ChangeEvent } from 'react';
|
import React, { ChangeEvent } from 'react';
|
||||||
import { ErrorInfo } from '../../../classes/client';
|
import { ErrorInfo } from '../../../classes/client';
|
||||||
|
|
||||||
@ -13,6 +14,8 @@ type InputProps = {
|
|||||||
autoComplete?: string;
|
autoComplete?: string;
|
||||||
fullWidth?: boolean;
|
fullWidth?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
maxLength?: number,
|
||||||
|
rows?: number
|
||||||
};
|
};
|
||||||
|
|
||||||
const Input = ({
|
const Input = ({
|
||||||
@ -26,6 +29,7 @@ const Input = ({
|
|||||||
autoComplete,
|
autoComplete,
|
||||||
fullWidth = true,
|
fullWidth = true,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
|
maxLength = 254,
|
||||||
}: InputProps): React.ReactElement => {
|
}: InputProps): React.ReactElement => {
|
||||||
const fieldError = error?.fields?.[name];
|
const fieldError = error?.fields?.[name];
|
||||||
return (
|
return (
|
||||||
@ -43,6 +47,7 @@ const Input = ({
|
|||||||
margin="dense"
|
margin="dense"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
autoComplete={autoComplete}
|
autoComplete={autoComplete}
|
||||||
|
inputProps={{ maxLength: maxLength }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -86,6 +86,7 @@ const CreateDialog = ({ onClose }: CreateProps): React.ReactElement => {
|
|||||||
onChange={handleOnChange}
|
onChange={handleOnChange}
|
||||||
error={error}
|
error={error}
|
||||||
fullWidth={true}
|
fullWidth={true}
|
||||||
|
maxLength={60}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
@ -99,6 +100,7 @@ const CreateDialog = ({ onClose }: CreateProps): React.ReactElement => {
|
|||||||
onChange={handleOnChange}
|
onChange={handleOnChange}
|
||||||
required={false}
|
required={false}
|
||||||
fullWidth={true}
|
fullWidth={true}
|
||||||
|
rows={3}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
Loading…
Reference in New Issue
Block a user