Skip to content

Commit

Permalink
fix: 🐛 Fix empty field
Browse files Browse the repository at this point in the history
  • Loading branch information
5ika committed Jun 14, 2024
1 parent 1048000 commit ff4accd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "es5",
"singleQuote": true,
"semi": false
}
10 changes: 6 additions & 4 deletions admin/src/components/MultiSelect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const CustomMultiValueContainer = (props) => {
type="button"
tabIndex={-1}
icon={<Cross />}
onClick={handleTagClick(props.data)}>
onClick={handleTagClick(props.data)}
>
{props.data.label}
</Tag>
)
Expand Down Expand Up @@ -83,7 +84,7 @@ const MultiSelect = ({
}
return Array.isArray(parsedValue)
? possibleOptions.filter((option) =>
parsedValue.some((val) => option.value === val),
parsedValue.some((val) => option.value === val)
)
: []
}, [value, possibleOptions])
Expand All @@ -97,7 +98,8 @@ const MultiSelect = ({
hint={description && formatMessage(description)}
error={fieldError}
name={name}
required={required}>
required={required}
>
<Flex direction="column" alignItems="stretch" gap={1}>
<FieldLabel>{formatMessage(intlLabel)}</FieldLabel>
<StyleSelect
Expand All @@ -108,7 +110,7 @@ const MultiSelect = ({
id={name}
disabled={disabled || possibleOptions.length === 0}
placeholder={placeholder}
defaultValue={sanitizedValue.map((val) => ({
value={sanitizedValue.map((val) => ({
label: formatMessage({
id: val.label,
defaultMessage: val.label,
Expand Down

0 comments on commit ff4accd

Please sign in to comment.