Skip to content

Commit b97c9db

Browse files
authored
fix(WarningModal): Reset check state on close (#128)
1 parent c08b52f commit b97c9db

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/module/src/WarningModal/WarningModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ const WarningModal: React.FunctionComponent<WarningModalProps> = ({
4444
ouiaId="primary-confirm-button"
4545
key="confirm"
4646
variant={confirmButtonVariant}
47-
onClick={onConfirm}
47+
onClick={() => {
48+
onConfirm?.();
49+
setChecked(false);
50+
}}
4851
isDisabled={withCheckbox && !checked}
4952
>
5053
{confirmButtonLabel}
@@ -64,7 +67,7 @@ const WarningModal: React.FunctionComponent<WarningModalProps> = ({
6467
{withCheckbox ? (
6568
<Checkbox
6669
isChecked={checked}
67-
onChange={() => setChecked(!checked)}
70+
onChange={(_event, value) => setChecked(value)}
6871
label={checkboxLabel}
6972
id="warning-modal-check"
7073
className="pf-v5-u-mt-lg"

0 commit comments

Comments
 (0)