diff options
author | Levi Lansing <helives@gmail.com> | 2017-09-28 10:15:29 -0400 |
---|---|---|
committer | Levi Lansing <helives@gmail.com> | 2017-09-28 10:15:29 -0400 |
commit | 1c72daf036bee06cde97639ac80b741c3ed38fa8 (patch) | |
tree | 46d9e60fe011c907538ca41b7a161d97ae245346 /src | |
parent | d18ecfb67877d8bdfc54e47a214d3afab52b7bda (diff) | |
download | time-picker-1c72daf036bee06cde97639ac80b741c3ed38fa8.tar.gz time-picker-1c72daf036bee06cde97639ac80b741c3ed38fa8.tar.zst time-picker-1c72daf036bee06cde97639ac80b741c3ed38fa8.zip |
select text when focusing time input
Diffstat (limited to 'src')
-rw-r--r-- | src/Header.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Header.jsx b/src/Header.jsx index 9e80a9c..6bed557 100644 --- a/src/Header.jsx +++ b/src/Header.jsx | |||
@@ -38,7 +38,10 @@ class Header extends Component { | |||
38 | if (this.props.focusOnOpen) { | 38 | if (this.props.focusOnOpen) { |
39 | // Wait one frame for the panel to be positioned before focusing | 39 | // Wait one frame for the panel to be positioned before focusing |
40 | const requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout); | 40 | const requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout); |
41 | requestAnimationFrame(() => this.refs.input.focus()); | 41 | requestAnimationFrame(() => { |
42 | this.refs.input.focus(); | ||
43 | this.refs.input.select(); | ||
44 | }); | ||
42 | } | 45 | } |
43 | } | 46 | } |
44 | 47 | ||