Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
♿️ added autofocus on first field of modal forms (#667)
Browse files Browse the repository at this point in the history
added to modals:
- invite user
- add item
- add collection
- add folder
  • Loading branch information
paulussujono authored Oct 6, 2020
1 parent 1193a93 commit 6bc5ac4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ <h2 class="modal-title" id="collectionAddEditTitle">{{title}}</h2>
<div class="modal-body" *ngIf="!loading">
<div class="form-group">
<label for="name">{{'name' | i18n}}</label>
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="name" required>
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="name" required
appAutofocus>
</div>
<div class="form-group">
<label for="externalId">{{'externalId' | i18n}}</label>
Expand Down
3 changes: 2 additions & 1 deletion src/app/organizations/manage/user-add-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ <h2 class="modal-title" id="userAddEditTitle">
<p>{{'inviteUserDesc' | i18n}}</p>
<div class="form-group mb-4">
<label for="emails">{{'email' | i18n}}</label>
<input id="emails" class="form-control" type="text" name="Emails" [(ngModel)]="emails" required>
<input id="emails" class="form-control" type="text" name="Emails" [(ngModel)]="emails" required
appAutoFocus>
<small class="text-muted">{{'inviteMultipleEmailDesc' | i18n : '20'}}</small>
</div>
</ng-container>
Expand Down
4 changes: 2 additions & 2 deletions src/app/vault/add-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ <h2 class="modal-title" id="cipherAddEditTitle">{{title}}</h2>
<div class="row" *ngIf="!editMode">
<div class="col-6 form-group">
<label for="type">{{'whatTypeOfItem' | i18n}}</label>
<select id="type" name="Type" [(ngModel)]="cipher.type" class="form-control"
[disabled]="cipher.isDeleted">
<select id="type" name="Type" [(ngModel)]="cipher.type" class="form-control"
[disabled]="cipher.isDeleted" appAutofocus>
<option *ngFor="let o of typeOptions" [ngValue]="o.value">{{o.name}}</option>
</select>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/vault/folder-add-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ <h2 class="modal-title" id="folderAddEditTitle">{{title}}</h2>
</div>
<div class="modal-body">
<label for="name">{{'name' | i18n}}</label>
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="folder.name" required>
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="folder.name" required
appAutofocus>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
Expand Down

0 comments on commit 6bc5ac4

Please sign in to comment.