Fix swatch and product list filters (#2087)
* Fix crashing * Fix character limit * Update snapshots
This commit is contained in:
parent
83988f08c5
commit
1879d0cfb3
3 changed files with 3 additions and 3 deletions
|
@ -143,7 +143,7 @@ export const ColorPicker: React.FC<ColorPickerProps> = ({
|
|||
helperText={errors?.value}
|
||||
className={classes.colorInput}
|
||||
InputProps={{ startAdornment: "HEX" }}
|
||||
inputProps={{ pattern: "[A-Za-z0-9]{6}", maxLength: 6 }}
|
||||
inputProps={{ pattern: "[A-Za-z0-9]{6}", maxLength: 7 }}
|
||||
value={`#${hex}`}
|
||||
onChange={event => handleHEXChange(event.target.value)}
|
||||
/>
|
||||
|
|
|
@ -60,7 +60,7 @@ const FilterAutocompleteField: React.FC<FilterAutocompleteFieldProps> = ({
|
|||
}) => {
|
||||
const classes = useStyles({});
|
||||
|
||||
const fieldDisplayValues = displayValues[filter.name];
|
||||
const fieldDisplayValues = displayValues[filter.name] ?? [];
|
||||
const initialFieldDisplayValues = initialDisplayValues[filter.name];
|
||||
const availableOptions = filter.options.filter(option =>
|
||||
fieldDisplayValues.every(
|
||||
|
|
|
@ -5912,7 +5912,7 @@ exports[`Storyshots Generics / ColorPicker default 1`] = `
|
|||
<input
|
||||
aria-invalid="false"
|
||||
class="MuiInputBase-input-id MuiOutlinedInput-input-id MuiInputBase-inputAdornedStart-id MuiOutlinedInput-inputAdornedStart-id"
|
||||
maxlength="6"
|
||||
maxlength="7"
|
||||
pattern="[A-Za-z0-9]{6}"
|
||||
type="text"
|
||||
value="#000000"
|
||||
|
|
Loading…
Reference in a new issue