diff options
author | 偏右 <afc163@gmail.com> | 2017-10-22 16:24:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-22 16:24:17 +0800 |
commit | 78598cc9f8608fc8bb1830d3384c8e7fd032eb3f (patch) | |
tree | d015484db93d83f9ea17fbe6b5602cd9936d37c8 /src/Header.jsx | |
parent | bcb307b79a2481bad496085b75b701bf864adc6d (diff) | |
parent | b6767d8a08ccfc52836e09e3a0886a5cf225b93f (diff) | |
download | time-picker-78598cc9f8608fc8bb1830d3384c8e7fd032eb3f.tar.gz time-picker-78598cc9f8608fc8bb1830d3384c8e7fd032eb3f.tar.zst time-picker-78598cc9f8608fc8bb1830d3384c8e7fd032eb3f.zip |
Merge branch 'master' into focus-on-open
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 6bed557..1520d25 100644 --- a/src/Header.jsx +++ b/src/Header.jsx | |||
@@ -23,6 +23,7 @@ class Header extends Component { | |||
23 | defaultOpenValue: PropTypes.object, | 23 | defaultOpenValue: PropTypes.object, |
24 | currentSelectPanel: PropTypes.string, | 24 | currentSelectPanel: PropTypes.string, |
25 | focusOnOpen: PropTypes.bool, | 25 | focusOnOpen: PropTypes.bool, |
26 | onKeyDown: PropTypes.func, | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | constructor(props) { | 29 | constructor(props) { |
@@ -134,9 +135,12 @@ class Header extends Component { | |||
134 | } | 135 | } |
135 | 136 | ||
136 | onKeyDown = (e) => { | 137 | onKeyDown = (e) => { |
138 | const { onEsc, onKeyDown } = this.props; | ||
137 | if (e.keyCode === 27) { | 139 | if (e.keyCode === 27) { |
138 | this.props.onEsc(); | 140 | onEsc(); |
139 | } | 141 | } |
142 | |||
143 | onKeyDown(e); | ||
140 | } | 144 | } |
141 | 145 | ||
142 | onClear = () => { | 146 | onClear = () => { |