Skip to content

Commit 4e03d70

Browse files
committed
Set autofocus for modal dialogs
1 parent a8228f6 commit 4e03d70

5 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/renderer/components/clone-repo-dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class CloneRepoForm extends React.PureComponent<CloneRepoFormProps, CloneRepoFor
7676
id='path'
7777
name='repo-path'
7878
value={this.state.repoPath}
79+
autoFocus={true}
7980
onChange={this.handleRepoPathChange} />
8081
<button type='button'
8182
onClick={this.handleBrowseClick}>

src/renderer/components/create-branch-dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class CreateBranchForm extends React.PureComponent<CreateBranchFormProps, Create
5555
id='name'
5656
name='repo-name'
5757
value={this.state.branchName}
58+
autoFocus={true}
5859
onChange={this.handleBranchNameChange} />
5960
</div>
6061
<div className='field-container'>

src/renderer/components/init-repo-dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class InitRepoForm extends React.PureComponent<InitRepoFormProps, InitRepoFormSt
7676
id='name'
7777
name='repo-name'
7878
value={this.state.repoName}
79+
autoFocus={true}
7980
onChange={this.handleRepoNameChange} />
8081
</div>
8182
<div className='field-container'>

src/renderer/components/make-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function makeModal<P extends ModalComponentProps, S>(Component: Component
2424

2525
render() {
2626
return (
27-
<div className='modal-container' onKeyUp={this.handleKeyUp} tabIndex={-1} ref={div => div && div.focus()}>
27+
<div className='modal-container' onKeyUp={this.handleKeyUp} tabIndex={-1}>
2828
<button className='modal-close-button' onClick={this.props.onClose}>
2929
Close
3030
</button>

src/renderer/components/preferences-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Preferences extends React.PureComponent<PreferencesProps, PreferencesState
149149
<form onSubmit={this.handleSubmit}>
150150
<div>
151151
<label htmlFor="name">Name:</label>
152-
<input type="text" id="name" name="profile-name" />
152+
<input type="text" id="name" name="profile-name" autoFocus={true} />
153153
</div>
154154
<div>
155155
<label htmlFor="path">Email:</label>

0 commit comments

Comments
 (0)