Skip to content

Commit

Permalink
Fix #7494: ConfirmDialog do not call onHide if dialog is not visible (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Dec 11, 2024
1 parent f782220 commit 785633f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/lib/confirmdialog/ConfirmDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ export const ConfirmDialog = React.memo(
};

const hide = (result = 'cancel') => {
setVisibleState(false);
callbackFromProp('onHide', { result });
DomHandler.focus(focusElementOnHide.current);
focusElementOnHide.current = null;
if (visibleState) {
setVisibleState(false);
callbackFromProp('onHide', { result });
DomHandler.focus(focusElementOnHide.current);
focusElementOnHide.current = null;
}
};

const confirm = (updatedProps) => {
Expand Down

0 comments on commit 785633f

Please sign in to comment.