diff --git a/index.d.ts b/index.d.ts index b940368..308def5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -21,7 +21,7 @@ declare module 'react-confirm-alert' { willUnmount?: () => void onClickOutside?: () => void onKeypressEscape?: () => void - onkeyPress?: () => void + onkeyPress?: (event: Event, onClose: () => void) => void overlayClassName?: string } diff --git a/src/index.js b/src/index.js index 9c28f12..30c2be0 100644 --- a/src/index.js +++ b/src/index.js @@ -82,7 +82,7 @@ export default class ReactConfirmAlert extends Component { } if (onkeyPress) { - onkeyPress() + onkeyPress(event, this.close.bind(this)) } }