Skip to content

Commit

Permalink
fix(2010): fix disabled dropdown item was able to click
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-deepfence committed Nov 28, 2023
1 parent d0daf9f commit 8ad9c4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ const ActionDropdown = ({
<>
<DropdownItem
disabled={isScanInProgress(scanStatus) || isScanStopping(scanStatus)}
onClick={() => {
onSelect={() => {
if (!nodeId) {
throw new Error('Node id is required to start scan');
}
Expand Down Expand Up @@ -586,6 +586,7 @@ const ActionDropdown = ({
<span
className={cn('flex items-center gap-x-2', {
'text-red-700 dark:text-status-error': scanId,
'dark:text-df-gray-600': !scanId || !nodeType,
})}
>
Delete latest scan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useSearchParams,
} from 'react-router-dom';
import { toast } from 'sonner';
import { cn } from 'tailwind-preset';
import {
Badge,
Breadcrumb,
Expand Down Expand Up @@ -415,7 +416,11 @@ const ActionDropdown = ({
}}
disabled={isScanInProgress(scanStatus)}
>
<span className="flex items-center text-red-700 dark:text-status-error">
<span
className={cn('flex items-center text-red-700 dark:text-status-error', {
'dark:text-df-gray-600': isScanInProgress(scanStatus),
})}
>
Delete
</span>
</DropdownItem>
Expand Down

0 comments on commit 8ad9c4c

Please sign in to comment.