close dropdown in teams to prevent z-index bug
problem
on https://app.cal.com/settings/teams when clicking
and selecting "disband team" it shows:
solution:
close dropdown when clicking "disband team"
I tried to fix this issue and arrived at two solutions
- currently the menu is being rendered in a portal and its
z-indexis2147483646if we passportalled={false}toDropdownMenuContentinTeamListItem.tsxthe issue is fixed - we can change the
z-indexof the Dialog component to2147483647which is one more than thez-indexof the portal in which theDropdownMenuContentis being rendered
I tried to fix the zIndex of the Dropdown component but I guess Radix-UI doesn't allow to change it
Hey, @PeerRich any thoughts on the above approaches?
I tried to fix this issue and arrived at two solutions
- currently the menu is being rendered in a portal and its
z-indexis2147483646if we passportalled={false}toDropdownMenuContentinTeamListItem.tsxthe issue is fixed- we can change the
z-indexof the Dialog component to2147483647which is one more than thez-indexof the portal in which theDropdownMenuContentis being renderedI tried to fix the zIndex of the
Dropdowncomponent but I guess Radix-UI doesn't allow to change it
why not close it? if possible we can change z-index but this problem would also be solved by just closing the dropdown
Ya that would be a better approach
I guess closing the dropdown is not what we should look for because we are stopping the click propagation at the modal trigger so the menu is not getting closed, even though we clicked the menu item, any feedback on this?
<DropdownMenuItem>
<Dialog>
<DialogTrigger asChild>
<Button
onClick={(e) => {
e.stopPropagation();
}}
color="warn"
size="sm"
className="w-full rounded-none font-medium"
StartIcon={Icon.Trash}>
{t("disband_team")}
</Button>
</DialogTrigger>
<ConfirmationDialogContent
variety="danger"
title={t("disband_team")}
confirmBtnText={t("confirm_disband_team")}
isLoading={props.isLoading}
onConfirm={() => {
props.onActionSelect("disband");
}}>
{t("disband_team_confirmation_message")}
</ConfirmationDialogContent>
</Dialog>
</DropdownMenuItem>
would need to see this in action, wanna open a PR?
Ya sure
There are currently two solution used in project:
- dropdown with ConfirmationDialogContent, like this place or remove team member

- or separate dialog with trigger button in dropdown like

the solution could be to prepare all dropdown like the second one, or add extra div like proposed PR https://github.com/calcom/cal.com/pull/3607
I don't know which alternative is better. I wonder how the team behind radix-ui is thinking of this (since both components are from radix)
@PeerRich I found discussion na radix github page. The solution is pretty straight forward and doesn't duplicate properties for potential new modals https://github.com/radix-ui/primitives/discussions/1436 I updated the PR https://github.com/calcom/cal.com/pull/3607. When it be accepted the same should be done for the "remove member" modal
@PeerRich I found discussion na radix github page. The solution is pretty straight forward and doesn't duplicate properties for potential new modals
https://github.com/radix-ui/primitives/discussions/1436
I updated the PR https://github.com/calcom/cal.com/pull/3607. When it be accepted the same should be done for the "remove member" modal
we will review and merge on monday π thank you
I would want to work on this.
go for it!
this has been fixed a while ago