diff --git a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx index dd5c602150..28c680b824 100644 --- a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx +++ b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx @@ -1,17 +1,25 @@ -import { Tooltip } from '@chakra-ui/react'; +import { FormControl, FormLabel, Tooltip } from '@chakra-ui/react'; import { MultiSelect, MultiSelectProps } from '@mantine/core'; import { useAppDispatch } from 'app/store/storeHooks'; import { shiftKeyPressed } from 'features/ui/store/hotkeysSlice'; import { useMantineMultiSelectStyles } from 'mantine-theme/hooks/useMantineMultiSelectStyles'; import { KeyboardEvent, RefObject, memo, useCallback } from 'react'; -type IAIMultiSelectProps = MultiSelectProps & { +type IAIMultiSelectProps = Omit & { tooltip?: string; inputRef?: RefObject; + label?: string; }; const IAIMantineMultiSelect = (props: IAIMultiSelectProps) => { - const { searchable = true, tooltip, inputRef, ...rest } = props; + const { + searchable = true, + tooltip, + inputRef, + label, + disabled, + ...rest + } = props; const dispatch = useAppDispatch(); const handleKeyDown = useCallback( @@ -37,7 +45,15 @@ const IAIMantineMultiSelect = (props: IAIMultiSelectProps) => { return ( + {label} + + ) : undefined + } ref={inputRef} + disabled={disabled} onKeyDown={handleKeyDown} onKeyUp={handleKeyUp} searchable={searchable} diff --git a/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx index edf1665bb4..2c3f5434ad 100644 --- a/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx +++ b/invokeai/frontend/web/src/common/components/IAIMantineSearchableSelect.tsx @@ -1,4 +1,4 @@ -import { Tooltip } from '@chakra-ui/react'; +import { FormControl, FormLabel, Tooltip } from '@chakra-ui/react'; import { Select, SelectProps } from '@mantine/core'; import { useAppDispatch } from 'app/store/storeHooks'; import { shiftKeyPressed } from 'features/ui/store/hotkeysSlice'; @@ -11,13 +11,22 @@ export type IAISelectDataType = { tooltip?: string; }; -type IAISelectProps = SelectProps & { +type IAISelectProps = Omit & { tooltip?: string; + label?: string; inputRef?: RefObject; }; const IAIMantineSearchableSelect = (props: IAISelectProps) => { - const { searchable = true, tooltip, inputRef, onChange, ...rest } = props; + const { + searchable = true, + tooltip, + inputRef, + onChange, + label, + disabled, + ...rest + } = props; const dispatch = useAppDispatch(); const [searchValue, setSearchValue] = useState(''); @@ -61,6 +70,14 @@ const IAIMantineSearchableSelect = (props: IAISelectProps) => { +