diff --git a/src/showcase/confirmpopup/ConfirmPopupDemo.js b/src/showcase/confirmpopup/ConfirmPopupDemo.js index ea74e28627..78cc84d15f 100644 --- a/src/showcase/confirmpopup/ConfirmPopupDemo.js +++ b/src/showcase/confirmpopup/ConfirmPopupDemo.js @@ -57,7 +57,7 @@ export class ConfirmPopupDemo extends Component {

ConfirmPopup

ConfirmPopup displays a confirmation overlay displayed relatively to its target.

-
+ diff --git a/src/showcase/confirmpopup/ConfirmPopupDoc.js b/src/showcase/confirmpopup/ConfirmPopupDoc.js index a40c0e6b63..4829ae0f73 100644 --- a/src/showcase/confirmpopup/ConfirmPopupDoc.js +++ b/src/showcase/confirmpopup/ConfirmPopupDoc.js @@ -310,7 +310,31 @@ const confirm = (event) => { `} +

The confirmPopup method returns an object incudes hide and show methods. The component can be shown or hidden by using this object at any time.

+ +{` +const confirm = (event) => { + const myConfirm = confirmPopup({ + target: event.currentTarget, + message: 'Are you sure you want to proceed?', + icon: 'pi pi-exclamation-triangle', + accept: () => acceptFunc(), + reject: () => rejectFunc() + }); + + setTimeout(() => { + myConfirm.hide(); + + setTimeout(() => { + myConfirm.show(); + }, 1000); + }, 500); +} + + +`} +
2. <ConfirmPopup> tag

ConfirmPopup is used as a container and visibility is managed with visible property where onHide event is required to update the visibility state.