Highlight input when user focuses

pull/2104/head
Alex P 2017-10-10 15:27:47 -07:00 committed by Andrew Watkins
parent 2c3ab050d7
commit 7b761d6ccb
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,10 @@ class DashboardEditHeader extends Component {
}
}
handleFocus = e => {
e.target.select()
}
render() {
const {onEditDashboard, isEditMode, dashboardName} = this.props
@ -52,6 +56,7 @@ class DashboardEditHeader extends Component {
spellCheck={false}
onBlur={this.handleInputBlur}
onKeyDown={this.handleKeyDown}
onFocus={this.handleFocus}
placeholder="Name this Dashboard"
ref={r => (this.inputRef = r)}
/>