mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
fix(web/input): fix select throwing error when there's no options sent
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { MultiSelect, Select } from '@mantine/core';
|
import { MultiSelect, Select } from '@mantine/core';
|
||||||
import { ISelect } from '../../../../typings/dialog';
|
import { ISelect } from '../../../../typings';
|
||||||
import { Control, useController } from 'react-hook-form';
|
import { Control, useController } from 'react-hook-form';
|
||||||
import { FormValues } from '../../InputDialog';
|
import { FormValues } from '../../InputDialog';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
@@ -14,7 +14,6 @@ const SelectField: React.FC<Props> = (props) => {
|
|||||||
const controller = useController({
|
const controller = useController({
|
||||||
name: `test.${props.index}.value`,
|
name: `test.${props.index}.value`,
|
||||||
control: props.control,
|
control: props.control,
|
||||||
defaultValue: props.row.default || props.row.type !== 'multi-select' ? props.row.options[0].value : undefined,
|
|
||||||
rules: { required: props.row.required },
|
rules: { required: props.row.required },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user