Skip to content

Commit

Permalink
fix: do not set anchor when using custom anchor (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
formatlos authored Mar 28, 2024
1 parent 9df0805 commit 3d9bdad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ export function usePopupState({
_openEventType: event?.type,
}

if (event?.currentTarget) {
if (!state.setAnchorElUsed) {
newState.anchorEl = event?.currentTarget as any
if (!state.setAnchorElUsed) {
if (event?.currentTarget) {
newState.anchorEl = event?.currentTarget as any
} else if (element) {
newState.anchorEl = element
}
} else if (element) {
newState.anchorEl = element
}

return newState
Expand Down

0 comments on commit 3d9bdad

Please sign in to comment.