Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

Commit 05a51dd

Browse files
author
Lorenz Henk
authored
Merge pull request #12 from smrsan76/feature/NicerTextWidgets
Used TextField instead of Input & InputLabel components
2 parents 92e6576 + 0ba7a43 commit 05a51dd

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/TextWidget/TextWidget.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from 'react';
22

33
import FormControl from '@material-ui/core/FormControl';
4-
import Input from '@material-ui/core/Input';
5-
import InputLabel from '@material-ui/core/InputLabel';
4+
import TextField from '@material-ui/core/TextField';
65

76
import { WidgetProps } from 'react-jsonschema-form';
87

@@ -36,9 +35,9 @@ const TextWidget = ({
3635
//error={!!rawErrors}
3736
required={required}
3837
>
39-
<InputLabel>{label || schema.title}</InputLabel>
40-
<Input
38+
<TextField
4139
id={id}
40+
label={label || schema.title}
4241
autoFocus={autofocus}
4342
required={required}
4443
disabled={disabled || readonly}

src/TextareaWidget/TextareaWidget.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import React from 'react';
33
import { WidgetProps } from 'react-jsonschema-form';
44

55
import FormControl from '@material-ui/core/FormControl';
6-
import Input from '@material-ui/core/Input';
7-
import InputLabel from '@material-ui/core/InputLabel';
6+
import TextField from '@material-ui/core/TextField';
87

98
type CustomWidgetProps = WidgetProps & {
109
options: any;
@@ -41,9 +40,9 @@ const TextareaWidget = ({
4140
//error={!!rawErrors}
4241
required={required}
4342
>
44-
<InputLabel>{label || schema.title}</InputLabel>
45-
<Input
43+
<TextField
4644
id={id}
45+
label={label || schema.title}
4746
placeholder={placeholder}
4847
disabled={disabled || readonly}
4948
value={value}

0 commit comments

Comments
 (0)