Skip to content

Commit

Permalink
in order for tooltip to work, we cannot pass it a disabled button
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Mar 5, 2024
1 parent 141845a commit 10f4598
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/features/environments/components/EnvironmentDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ export const EnvironmentDropdown = ({
}
>
<StyledIconButton
onClick={e => onCreateNewEnvironmentTab(e, namespace)}
disabled={!canCreate}
onClick={e =>
canCreate && onCreateNewEnvironmentTab(e, namespace)
}
aria-disabled={!canCreate}
>
<AddIcon />
</StyledIconButton>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/StyledIconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const StyledIconButton = styled(Button)(({ theme }) => ({
outlineWidth: "medium",
transition: "none"
},
"&:disabled": {
'&[aria-disabled="true"]': {
backgroundColor: theme.palette.secondary[100],
border: "none",
color: theme.palette.secondary[300]
Expand Down

0 comments on commit 10f4598

Please sign in to comment.