Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Fix hookstate bugs (101, 102) in SelectInput (#10442)
Browse files Browse the repository at this point in the history
  • Loading branch information
CITIZENDOT authored Jun 24, 2024
1 parent 33030f4 commit 1498edd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/primitives/tailwind/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Select = <T extends OptionValueType>({
const ref = useRef<HTMLDivElement>(null)
const { t } = useTranslation()
const showOptions = useHookstate(false)
const filteredOptions = useHookstate(options)
const filteredOptions = useHookstate(JSON.parse(JSON.stringify(options)))
const selectLabel = useHookstate('')

useClickOutside(ref, () => showOptions.set(false))
Expand All @@ -90,7 +90,7 @@ const Select = <T extends OptionValueType>({
}, [currentValue, options])

useEffect(() => {
filteredOptions.set(options)
filteredOptions.set(JSON.parse(JSON.stringify(options)))
}, [options])

const toggleDropdown = () => {
Expand Down

0 comments on commit 1498edd

Please sign in to comment.