Skip to content

Commit

Permalink
fix: don't warn about eventOrAnchorEl when variant is dialog
Browse files Browse the repository at this point in the history
fix #118
  • Loading branch information
jedwards1211 committed Mar 20, 2023
1 parent 67ac8da commit c50ce77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function usePopupState({
: undefined

const doOpen = (state: CoreState): CoreState => {
if (!eventOrAnchorEl && !state.setAnchorElUsed) {
if (!eventOrAnchorEl && !state.setAnchorElUsed && variant !== 'dialog') {
warn(
'missingEventOrAnchorEl',
'eventOrAnchorEl should be defined if setAnchorEl is not used'
Expand Down

0 comments on commit c50ce77

Please sign in to comment.