mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 01:56:01 +08:00
fix: transition in simple select causes page crash (#16587)
This commit is contained in:
parent
17b4d4c7b2
commit
cea4669b76
@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import React, { Fragment, useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { Combobox, ComboboxButton, ComboboxInput, ComboboxOption, ComboboxOptions, Listbox, ListboxButton, ListboxOption, ListboxOptions, Transition } from '@headlessui/react'
|
import { Combobox, ComboboxButton, ComboboxInput, ComboboxOption, ComboboxOptions, Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/react'
|
||||||
import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/20/solid'
|
import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/20/solid'
|
||||||
import Badge from '../badge/index'
|
import Badge from '../badge/index'
|
||||||
import { RiCheckLine } from '@remixicon/react'
|
import { RiCheckLine } from '@remixicon/react'
|
||||||
@ -238,13 +238,6 @@ const SimpleSelect: FC<ISelectProps> = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{!disabled && (
|
{!disabled && (
|
||||||
<Transition
|
|
||||||
as={Fragment}
|
|
||||||
leave="transition ease-in duration-100"
|
|
||||||
leaveFrom="opacity-100"
|
|
||||||
leaveTo="opacity-0"
|
|
||||||
>
|
|
||||||
|
|
||||||
<ListboxOptions className={classNames('absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-components-panel-bg-blur backdrop-blur-sm py-1 text-base shadow-lg border-components-panel-border border-[0.5px] focus:outline-none sm:text-sm', optionWrapClassName)}>
|
<ListboxOptions className={classNames('absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-components-panel-bg-blur backdrop-blur-sm py-1 text-base shadow-lg border-components-panel-border border-[0.5px] focus:outline-none sm:text-sm', optionWrapClassName)}>
|
||||||
{items.map((item: Item) => (
|
{items.map((item: Item) => (
|
||||||
<ListboxOption
|
<ListboxOption
|
||||||
@ -279,7 +272,6 @@ const SimpleSelect: FC<ISelectProps> = ({
|
|||||||
</ListboxOption>
|
</ListboxOption>
|
||||||
))}
|
))}
|
||||||
</ListboxOptions>
|
</ListboxOptions>
|
||||||
</Transition>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Listbox>
|
</Listbox>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user