fix: hidden box dropdown hardware if no list (#3872)

This commit is contained in:
Faisal Amir 2024-10-23 17:52:36 +07:00 committed by GitHub
parent 33eda227a5
commit 0c78aadf1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -315,25 +315,25 @@ const Advanced = () => {
</div> </div>
</div> </div>
{gpuList.length > 0 && ( <div className="mt-2 flex w-full flex-col rounded-lg px-2 py-4">
<div className="mt-2 flex w-full flex-col rounded-lg px-2 py-4"> <label className="mb-2 mr-2 inline-block font-medium">
<label className="mb-2 mr-2 inline-block font-medium"> Choose device(s)
Choose device(s) </label>
</label> <div className="relative w-full md:w-1/2" ref={setToggle}>
<div className="relative w-full md:w-1/2" ref={setToggle}> <Input
<Input value={selectedGpu.join() || ''}
value={selectedGpu.join() || ''} className="w-full cursor-pointer"
className="w-full cursor-pointer" readOnly
readOnly placeholder=""
placeholder="" suffixIcon={
suffixIcon={ <ChevronDownIcon
<ChevronDownIcon size={14}
size={14} className={twMerge(open && 'rotate-180')}
className={twMerge(open && 'rotate-180')} />
/> }
} onClick={() => setOpen(!open)}
onClick={() => setOpen(!open)} />
/> {gpuList.length > 0 && (
<div <div
className={twMerge( className={twMerge(
'absolute right-0 top-0 z-20 mt-10 max-h-80 w-full overflow-hidden rounded-lg border border-[hsla(var(--app-border))] bg-[hsla(var(--app-bg))] shadow-sm', 'absolute right-0 top-0 z-20 mt-10 max-h-80 w-full overflow-hidden rounded-lg border border-[hsla(var(--app-border))] bg-[hsla(var(--app-bg))] shadow-sm',
@ -391,9 +391,9 @@ const Advanced = () => {
</div> </div>
</div> </div>
</div> </div>
</div> )}
</div> </div>
)} </div>
</div> </div>
)} )}