aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Header.jsx
diff options
context:
space:
mode:
authorshoaibbhimani <shoaibbhimani1392@gmail.com>2017-08-24 16:41:19 +0530
committershoaibbhimani <shoaibbhimani1392@gmail.com>2017-08-24 16:41:19 +0530
commit0e4fd1626e460bd52a82de3f12f84d88f652dd7e (patch)
tree3cf72e1fa9efb52f0bb6486d962b2a6d70ff2447 /src/Header.jsx
parent227e6ec28c733bba0a4b56e0583058489c0684a6 (diff)
downloadtime-picker-0e4fd1626e460bd52a82de3f12f84d88f652dd7e.tar.gz
time-picker-0e4fd1626e460bd52a82de3f12f84d88f652dd7e.tar.zst
time-picker-0e4fd1626e460bd52a82de3f12f84d88f652dd7e.zip
Add keydown function on header input
Diffstat (limited to 'src/Header.jsx')
-rw-r--r--src/Header.jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Header.jsx b/src/Header.jsx
index 91e8549..f6dd241 100644
--- a/src/Header.jsx
+++ b/src/Header.jsx
@@ -22,6 +22,7 @@ class Header extends Component {
22 allowEmpty: PropTypes.bool, 22 allowEmpty: PropTypes.bool,
23 defaultOpenValue: PropTypes.object, 23 defaultOpenValue: PropTypes.object,
24 currentSelectPanel: PropTypes.string, 24 currentSelectPanel: PropTypes.string,
25 onKeyDown: PropTypes.func,
25 }; 26 };
26 27
27 constructor(props) { 28 constructor(props) {
@@ -122,9 +123,12 @@ class Header extends Component {
122 } 123 }
123 124
124 onKeyDown = (e) => { 125 onKeyDown = (e) => {
126 const { onEsc, onKeyDown } = this.props;
125 if (e.keyCode === 27) { 127 if (e.keyCode === 27) {
126 this.props.onEsc(); 128 onEsc();
127 } 129 }
130
131 onKeyDown(e);
128 } 132 }
129 133
130 onClear = () => { 134 onClear = () => {