Skip to content

Commit 299677a

Browse files
committed
fix: prevent card action on disabled SourceTypeCard
1 parent 339937d commit 299677a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/Shared/Components/WorkflowOptionsModal/SourceTypeCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const SourceTypeCard = ({
5454
tabIndex={isDisabled ? -1 : 0}
5555
aria-disabled={isDisabled}
5656
className={`source-type-card flexbox-col bg__primary br-8 border__secondary-translucent ${isDisabled ? 'dc__disabled' : ''} `}
57-
onClick={onCardAction}
58-
onKeyDown={onCardAction}
57+
onClick={isDisabled ? undefined : onCardAction}
58+
onKeyDown={isDisabled ? undefined : onCardAction}
5959
>
6060
{!!icons.length && (
6161
<div className="source-type-card__icons flex bg__tertiary br-6 px-12 py-16 m-4">

src/Shared/Components/WorkflowOptionsModal/WorkflowOptionsModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ const WorkflowOptionsModal = ({
6060
// CONSTANTS
6161
const currentPipelineType = useMemo(
6262
() => getCurrentPipelineType({ workflows, changeCIPayload }),
63-
[workflows, changeCIPayload],
63+
// Expecting modal to be closed in case of workflows or changeCIPayload change
64+
[],
6465
)
6566

6667
const buildWorkflowCards = useMemo(

0 commit comments

Comments
 (0)