Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Add text selecting initially #742
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed May 16, 2017
1 parent d4a89bd commit 4099de0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/app/OverlayField.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class OverlayField extends Component {
noLabel={false}
filterWidget={true}
autoFocus={index === 0}
textSelected={true}
{...{handlePatch, handleChange, windowType, onShow, onHide,
viewId}}
/>
Expand Down
6 changes: 5 additions & 1 deletion src/components/widget/RawWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ class RawWidget extends Component {
}

componentDidMount(){
const {autoFocus} = this.props
const {autoFocus, textSelected} = this.props

if(this.rawWidget && autoFocus){
this.rawWidget.focus();
}

if(textSelected){
this.rawWidget.select();
}
}

handleFocus = (e) => {
Expand Down

0 comments on commit 4099de0

Please sign in to comment.