Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Text field input props #80

Merged
merged 2 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/inputs/TextField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function TextField({
<CustomTextField
{...rest}
{...customProps}
{...inputRest}
inputProps={inputRest}
className={className}
size={undefined}
name={name}
Expand Down
15 changes: 15 additions & 0 deletions src/inputs/TextField/textField.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ export const SimpleTextField = (): React.ReactElement => {
);
};

export const SimpleNumberField = (): React.ReactElement => {
const [value, setValue] = useState<string>('');
return (
<form noValidate autoComplete="off" onSubmit={onSubmit}>
<TextField
id="standard-name"
label="Name"
value={value}
onChange={(e) => setValue(e.target.value)}
input={{ type: 'number', min: 5, max: 10, step: 1 }}
/>
</form>
);
};

export const Error = (): React.ReactElement => {
const [value, setValue] = useState<string>('some incorrect value');
return (
Expand Down