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

Comments

Projects
None yet
6 participants
@dotequiet

dotequiet commented Jan 3, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

benjycui commented Jan 4, 2018

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

@benjycui benjycui closed this Jan 4, 2018

@afc163 afc163 reopened this Jan 4, 2018

@afc163

This comment has been minimized.

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

This comment has been minimized.

dotequiet commented Jan 4, 2018

@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