Skip to content

Commit

Permalink
Pass config to MaterialIntegerControl (#1422)
Browse files Browse the repository at this point in the history
The config was not being passed to the MaterialInputControl in MaterialIntegerControl. This meant showUnfocusedDescription config was not being used.
  • Loading branch information
Lily authored and edgarmueller committed Jul 3, 2019
1 parent 523160e commit d2eb8f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/examples/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const schema = {
type: 'string',
description: 'A Postal Code',
maxLength: 5
},
recurrenceInterval: {
type: 'integer',
description: 'A recurrence interval'
}
}
};
Expand All @@ -45,6 +49,11 @@ export const uischema = {
type: 'Control',
scope: '#/properties/postalCode',
label: 'Postal Code'
},
{
type: 'Control',
scope: '#/properties/recurrenceInterval',
label: 'Recurrence Interval'
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion packages/material/src/controls/MaterialIntegerControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class MaterialIntegerControl extends Control<
render() {
return (
<JsonFormsContext.Consumer>
{({ core, dispatch }: any) => {
{({ core, dispatch, config }: any) => {
const stateProps = mapStateToControlProps(
{ jsonforms: { core } },
this.props
Expand All @@ -54,6 +54,7 @@ export class MaterialIntegerControl extends Control<
{...stateProps}
{...dispatchProps}
input={MuiInputInteger}
config={config}
/>
);
}}
Expand Down

0 comments on commit d2eb8f1

Please sign in to comment.