Skip to content

Commit

Permalink
Revert "Alternative"
Browse files Browse the repository at this point in the history
This reverts commit 050ab95.
  • Loading branch information
estrattonbailey committed Jan 8, 2025
1 parent 050ab95 commit a13bbe4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/Menu/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ const RadixTriggerPassThrough = React.forwardRef(
)
RadixTriggerPassThrough.displayName = 'RadixTriggerPassThrough'

let prevControlIsOpen = false

export function Trigger({children, label, role = 'button'}: TriggerProps) {
const {control} = useMenuContext()
const {
Expand All @@ -121,13 +119,10 @@ export function Trigger({children, label, role = 'button'}: TriggerProps) {
} = useInteractionState()
const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState()

const open = Boolean(prevControlIsOpen || control.isOpen)
const prevControlIsOpen = React.useRef(control.isOpen)
const open = prevControlIsOpen.current || control.isOpen
const activated = Boolean(hovered || focused || open)
prevControlIsOpen = !!control.isOpen

React.useEffect(() => {
prevControlIsOpen = false
}, [])
prevControlIsOpen.current = control.isOpen

return (
<DropdownMenu.Trigger asChild>
Expand Down

0 comments on commit a13bbe4

Please sign in to comment.