Skip to content

Commit

Permalink
Fix jumping form by setting min-height to error element
Browse files Browse the repository at this point in the history
  • Loading branch information
TheZoker committed May 11, 2021
1 parent eec699f commit 6333f3e
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@jsonforms/material-renderers';
import RatingControl from './RatingControl';
import ratingControlTester from './ratingControlTester';
import { makeStyles } from '@material-ui/core/styles';
import { createMuiTheme, makeStyles, ThemeProvider } from '@material-ui/core/styles';

const useStyles = makeStyles((_theme) => ({
container: {
Expand Down Expand Up @@ -41,6 +41,16 @@ const useStyles = makeStyles((_theme) => ({
},
}));

const theme = createMuiTheme({
overrides: {
MuiFormHelperText: {
root: {
minHeight: '1.6em'
}
}
}
});

const initialData = {
name: 'Send email to Adrian',
description: 'Confirm if you have passed the subject\nHereby ...',
Expand Down Expand Up @@ -105,14 +115,16 @@ const App = () => {
Rendered form
</Typography>
<div className={classes.demoform}>
<JsonForms
schema={schema}
uischema={uischema}
data={jsonformsData}
renderers={renderers}
cells={materialCells}
onChange={({ errors, data }) => setJsonformsData(data)}
/>
<ThemeProvider theme={theme}>
<JsonForms
schema={schema}
uischema={uischema}
data={jsonformsData}
renderers={renderers}
cells={materialCells}
onChange={({ errors, data }) => setJsonformsData(data)}
/>
</ThemeProvider>
</div>
</Grid>
</Grid>
Expand Down

0 comments on commit 6333f3e

Please sign in to comment.