diff options
author | 偏右 <afc163@gmail.com> | 2017-10-22 16:21:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-22 16:21:13 +0800 |
commit | 2fb27d673619b7bdd70178e617965a009fa72874 (patch) | |
tree | ea0fbc39836f90d42308c6035d7834d25923df40 /src/Header.jsx | |
parent | 6022baedfba9ec831d9fddaf7979771a71ca7fb8 (diff) | |
parent | 0e4fd1626e460bd52a82de3f12f84d88f652dd7e (diff) | |
download | time-picker-2fb27d673619b7bdd70178e617965a009fa72874.tar.gz time-picker-2fb27d673619b7bdd70178e617965a009fa72874.tar.zst time-picker-2fb27d673619b7bdd70178e617965a009fa72874.zip |
Merge pull request #60 from shoaibbhimani/master
Add keydown function on header input
Diffstat (limited to 'src/Header.jsx')
-rw-r--r-- | src/Header.jsx | 6 |
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 = () => { |