mirror of
https://github.com/rowyio/rowy.git
synced 2026-07-13 05:48:53 +02:00
fix sideDrawer single select
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user