Skip to content

Trigger a modal from a dropdown #2008

Discussion options

You must be logged in to vote

@stefanwright1988 @theonlyway @thebashpotato Hey, i found a fix and its pretty simple, Just put the modal outside of dropdown

<Dropdown className="cursor-pointer" placement="left-start">
  <DropdownMenu
    onAction={(key) => {
      if (key === "invite user") {
        inviteUserModel.onOpen();
      }

      if (key === "deactivate_workspace") {
        deleteUserModel.onOpen();
      }

      if (key === "workspace settings") {
        navigate(`/dashboard/${workspace_name}/settings`);
      }
    }}
    aria-label="Profile Actions"
    variant="flat"
  >
    {/* Dropdown menu items */}
  </DropdownMenu>
</Dropdown>

// this is the modal and InviteUserModal is basically things returned…

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@stefanwright1988
Comment options

Comment options

You must be logged in to vote
4 replies
@KnightKrusty
Comment options

@stefanwright1988
Comment options

@KnightKrusty
Comment options

@knightvibhi
Comment options

Answer selected by stefanwright1988
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@shansubra
Comment options

@theonlyway
Comment options

@shansubra
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants