From b16f628352e4605b261bfc6938e1f45009b467a5 Mon Sep 17 00:00:00 2001 From: shakti97 Date: Fri, 24 Apr 2020 00:29:33 +0530 Subject: [PATCH] Enhancement(Esc key hide modal) --- client/modules/IDE/pages/IDEView.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index 2b0fd714..eba7b76c 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -170,6 +170,14 @@ class IDEView extends React.Component { } else { this.props.expandConsole(); } + } else if (e.keyCode === 27) { + if (this.props.ide.newFolderModalVisible) { + this.props.closeNewFolderModal(); + } else if (this.props.ide.uploadFileModalVisible) { + this.props.closeUploadFileModal(); + } else if (this.props.ide.modalIsVisible) { + this.props.closeNewFileModal(); + } } } @@ -562,6 +570,7 @@ IDEView.propTypes = { closeProjectOptions: PropTypes.func.isRequired, newFolder: PropTypes.func.isRequired, closeNewFolderModal: PropTypes.func.isRequired, + closeNewFileModal: PropTypes.func.isRequired, createFolder: PropTypes.func.isRequired, closeShareModal: PropTypes.func.isRequired, showEditorOptions: PropTypes.func.isRequired,