fix sideDrawer single select

This commit is contained in:
Shams mosowi
2020-07-04 13:44:18 +08:00
parent 8f0a191bfe
commit 8564966497
2 changed files with 14 additions and 3 deletions

View File

@@ -10,8 +10,13 @@ export default function MultiSelect({
field,
form,
editable,
config,
...props
}: FieldProps<string[]> & MultiSelectProps<string> & { editable?: boolean }) {
}: FieldProps<string[]> &
MultiSelectProps<string> & {
config: { options: string[] };
editable?: boolean;
}) {
const theme = useTheme();
const handleDelete = (index: number) => () => {
@@ -19,7 +24,7 @@ export default function MultiSelect({
newValues.splice(index, 1);
form.setFieldValue(field.name, newValues);
};
const { config } = props as any;
return (
<>
<MultiSelectA

View File

@@ -14,8 +14,13 @@ export default function SingleSelect({
field,
form,
editable,
config,
...props
}: FieldProps<string> & MultiSelectProps<string> & { editable: boolean }) {
}: FieldProps<string> &
MultiSelectProps<string> & {
config: { options: string[] };
editable: boolean;
}) {
const theme = useTheme();
const handleChange = value => form.setFieldValue(field.name, value);
@@ -24,6 +29,7 @@ export default function SingleSelect({
<>
<MultiSelect
{...props}
options={config.options}
multiple={false}
value={field.value}
onChange={handleChange}