javascript – Opening Dialog Inside DropDownMenu Shadcn UI React JS

I am trying to have a button in my DropDownMenu from Shadcn UI that opens a Dialog component.

I have two options.

  1. I trigger the Dialog from the DropDownMenuItem component
  2. I trigger the Dialog from a separate Button component

OPTION 1 PROBLEM

The DropDownMenu & Dialog are closed immediately simultaneously

OPTION 2 PROBLEM

The DropDownMenu remains open

Here is my minimal example code for option 1; Does anyone have a solution?


  
    
  
  
    Organisation
    
      
        
          
        
        {...dialogContent}
      
    
  
;

Read more here: Source link