Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how forbid esc close modal #8818

Closed
dotequiet opened this issue Jan 3, 2018 · 4 comments
Closed

how forbid esc close modal #8818

dotequiet opened this issue Jan 3, 2018 · 4 comments
Assignees
Labels

Comments

@dotequiet
Copy link

Version

3.1.0

Environment

develop

Reproduction link

https://ant.design/components/modal-cn/#components-modal-demo-manual

Steps to reproduce

esc close modal

What is expected?

controll esc close modal, if need esc close modal close else not close modal

What is actually happening?

can't controll esc close modal

@dengfuping
Copy link
Contributor

dengfuping commented Jan 4, 2018

@dotequiet The key event of "Esc" calls the onCancel function by default. And there is no option to forbid it.

@benjycui
Copy link
Contributor

benjycui commented Jan 4, 2018

Just control Modal[visible], think in React, instead Ext.js

@benjycui benjycui closed this as completed Jan 4, 2018
@afc163 afc163 reopened this Jan 4, 2018
@afc163
Copy link
Member

afc163 commented Jan 4, 2018

We can pass the keyboard config into Modal.confirm:

className={classString}
onCancel={close.bind(this, { triggerCancel: true })}
visible={visible}
title=""
transitionName="zoom"
footer=""
maskTransitionName="fade"
maskClosable={maskClosable}
style={style}
width={width}
zIndex={zIndex}
afterClose={afterClose}

@dotequiet
Copy link
Author

@afc163 controll onCancel is ok, but cancel btn and x is invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants