Skip to content

Commit

Permalink
Refactor #1951 - For ConfirmPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 12, 2021
1 parent 9bbab99 commit 51f952f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/confirmpopup/ConfirmPopup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface ConfirmPopupProps {
dismissable?: boolean;
footer?: TemplateType;
transitionOptions?: object;
onShow?(): void;
onHide?(result: string): void;
accept?(): void;
reject?(): void;
Expand Down
4 changes: 4 additions & 0 deletions src/components/confirmpopup/ConfirmPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class ConfirmPopup extends Component {
appendTo: null,
dismissable: true,
footer: null,
onShow: null,
onHide: null,
accept: null,
reject: null,
Expand All @@ -86,6 +87,7 @@ export class ConfirmPopup extends Component {
appendTo: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
dismissable: PropTypes.bool,
footer: PropTypes.any,
onShow: PropTypes.func,
onHide: PropTypes.func,
accept: PropTypes.func,
reject: PropTypes.func,
Expand Down Expand Up @@ -241,6 +243,8 @@ export class ConfirmPopup extends Component {
this.bindDocumentClickListener();
this.bindScrollListener();
this.bindResizeListener();

this.props.onShow && this.props.onShow();
}

onExit() {
Expand Down
5 changes: 5 additions & 0 deletions src/showcase/confirmpopup/ConfirmPopupDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ const confirm = (event) => {
Valid values are 'accept', 'reject' and undefined (outside click).</td>
<td>Callback to invoke when confirm popup is hidden.</td>
</tr>
<tr>
<td>onShow</td>
<td>-</td>
<td>Callback to invoke when overlay panel becomes visible.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 51f952f

Please sign in to comment.