From 1c72daf036bee06cde97639ac80b741c3ed38fa8 Mon Sep 17 00:00:00 2001 From: Levi Lansing Date: Thu, 28 Sep 2017 10:15:29 -0400 Subject: select text when focusing time input --- src/Header.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 { if (this.props.focusOnOpen) { // Wait one frame for the panel to be positioned before focusing const requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout); - requestAnimationFrame(() => this.refs.input.focus()); + requestAnimationFrame(() => { + this.refs.input.focus(); + this.refs.input.select(); + }); } } -- cgit v1.2.3