Skip to content

Commit

Permalink
support keyboard for Modal.confirm, close #8818
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Feb 11, 2018
1 parent 0e591ef commit 220d28d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface ModalProps {
bodyStyle?: React.CSSProperties;
maskStyle?: React.CSSProperties;
mask?: boolean;
keyboard?: boolean;
}

export interface ModalFuncProps {
Expand All @@ -68,6 +69,7 @@ export interface ModalFuncProps {
okCancel?: boolean;
style?: React.CSSProperties;
type?: string;
keyboard?: boolean;
}

export type ModalFunc = (props: ModalFuncProps) => {
Expand Down
3 changes: 2 additions & 1 deletion components/modal/confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface ConfirmDialogProps extends ModalFuncProps {
const IS_REACT_16 = !!ReactDOM.createPortal;

const ConfirmDialog = (props: ConfirmDialogProps) => {
const { onCancel, onOk, close, zIndex, afterClose, visible } = props;
const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard } = props;
const iconType = props.iconType || 'question-circle';
const okType = props.okType || 'primary';
const prefixCls = props.prefixCls || 'ant-confirm';
Expand Down Expand Up @@ -55,6 +55,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
width={width}
zIndex={zIndex}
afterClose={afterClose}
keyboard={keyboard}
>
<div className={`${prefixCls}-body-wrapper`}>
<div className={`${prefixCls}-body`}>
Expand Down

0 comments on commit 220d28d

Please sign in to comment.