Skip to content

Commit

Permalink
Fix dropdowns no longer opening after first open (#9668)
Browse files Browse the repository at this point in the history
- Fix enso-org/cloud-v2#1178
- Fix dropdowns not reopening after a third click (open -> close -> should open again)

# Important Notes
None
  • Loading branch information
somebody1234 authored Apr 10, 2024
1 parent 21ede86 commit 0fcb005
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/ide-desktop/lib/dashboard/src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function Dropdown<T>(props: DropdownProps<T>, ref: React.ForwardedRef<HTMLDivEle
onClick={event => {
event.stopPropagation()
if (!justFocusedRef.current && !readOnly) {
setIsDropdownVisible(false)
setIsDropdownVisible(!isDropdownVisible)
}
justFocusedRef.current = false
}}
Expand Down Expand Up @@ -285,8 +285,7 @@ function Dropdown<T>(props: DropdownProps<T>, ref: React.ForwardedRef<HTMLDivEle
onClick={event => {
event.stopPropagation()
if (!justFocusedRef.current && !readOnly) {
setIsDropdownVisible(false)
justBlurredRef.current = true
setIsDropdownVisible(!isDropdownVisible)
}
justFocusedRef.current = false
}}
Expand Down

0 comments on commit 0fcb005

Please sign in to comment.