Skip to content

Commit

Permalink
- Fixed issue with the wrong placement of the list
Browse files Browse the repository at this point in the history
  - Updated tests accordingly
- Also added `source-map-loader` to `playground` dev dependencies to fix playground
  • Loading branch information
heath-freenome committed Aug 29, 2022
1 parent 6442f98 commit c6bea91
Show file tree
Hide file tree
Showing 7 changed files with 10,296 additions and 16,298 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ const BaseInputTemplate = ({
// Now we need to pull out the step, min, max into an inner `inputProps` for material-ui
const { step, min, max, ...rest } = inputProps;
const otherProps = {
inputProps: { step, min, max },
inputProps: {
step,
min,
max,
...(schema.examples ? { list: `examples_${id}` } : undefined),
},
...rest,
...(schema.examples ? { list: `examples_${id}` } : undefined),
};
const _onChange = ({
target: { value },
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/test/__snapshots__/Form.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,6 @@ exports[`single fields schema examples 1`] = `
>
<div
className="MuiFormControl-root MuiTextField-root"
list="examples_root"
>
<div
className="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl"
Expand All @@ -1491,6 +1490,7 @@ exports[`single fields schema examples 1`] = `
className="MuiInputBase-input MuiInput-input"
disabled={false}
id="root"
list="examples_root"
onAnimationStart={[Function]}
onBlur={[Function]}
onChange={[Function]}
Expand Down
8 changes: 6 additions & 2 deletions packages/mui/src/BaseInputTemplate/BaseInputTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ const BaseInputTemplate = ({
// Now we need to pull out the step, min, max into an inner `inputProps` for material-ui
const { step, min, max, ...rest } = inputProps;
const otherProps = {
inputProps: { step, min, max },
inputProps: {
step,
min,
max,
...(schema.examples ? { list: `examples_${id}` } : undefined),
},
...rest,
...(schema.examples ? { list: `examples_${id}` } : undefined),
};
const _onChange = ({
target: { value },
Expand Down
2 changes: 1 addition & 1 deletion packages/mui/test/__snapshots__/Form.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6500,7 +6500,6 @@ label[data-shrink=false]+.MuiInputBase-formControl .emotion-3:focus::-ms-input-p
>
<div
className="MuiFormControl-root MuiTextField-root emotion-1"
list="examples_root"
>
<div
className="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl emotion-2"
Expand All @@ -6512,6 +6511,7 @@ label[data-shrink=false]+.MuiInputBase-formControl .emotion-3:focus::-ms-input-p
className="MuiInputBase-input MuiOutlinedInput-input emotion-3"
disabled={false}
id="root"
list="examples_root"
onAnimationStart={[Function]}
onBlur={[Function]}
onChange={[Function]}
Expand Down
Loading

0 comments on commit c6bea91

Please sign in to comment.