Improve autocapitalization of form inputs for budgets, transactions, and categories

This commit is contained in:
William Brawner 2022-11-08 20:36:05 -07:00
parent 170214c1ca
commit 3981e575f2
4 changed files with 8 additions and 9 deletions

View file

@ -4,10 +4,10 @@
</div>
<div *ngIf="!isLoading && budget" class="form budget-form">
<mat-form-field>
<input matInput [(ngModel)]="budget.name" placeholder="Name" required>
<input matInput [(ngModel)]="budget.name" placeholder="Name" required autocapitalize="words">
</mat-form-field>
<mat-form-field>
<textarea matInput [(ngModel)]="budget.description" placeholder="Description"></textarea>
<textarea matInput [(ngModel)]="budget.description" placeholder="Description" autocapitalize="sentences"></textarea>
</mat-form-field>
<button mat-raised-button color="accent" (click)="save()">Save</button>
<button class="button-delete" mat-raised-button color="warn" *ngIf="!create" (click)="delete()">Delete</button>

View file

@ -3,13 +3,13 @@
</div>
<div *ngIf="currentCategory" class="form category-form">
<mat-form-field (keyup.enter)="doAction()">
<input matInput [(ngModel)]="currentCategory.title" placeholder="Name" required>
<input matInput [(ngModel)]="currentCategory.title" placeholder="Name" required autocapitalize="words">
</mat-form-field>
<mat-form-field (keyup.enter)="doAction()">
<textarea matInput [(ngModel)]="currentCategory.description" placeholder="Description"></textarea>
<textarea matInput [(ngModel)]="currentCategory.description" placeholder="Description" autocapitalize="sentences"></textarea>
</mat-form-field>
<mat-form-field (keyup.enter)="doAction()">
<input matInput type="text" [(ngModel)]="currentCategory.amount" placeholder="Amount" required>
<input matInput type="input" [(ngModel)]="currentCategory.amount" placeholder="Amount" required step="0.01">
</mat-form-field>
<mat-radio-group [(ngModel)]="currentCategory.expense">
<mat-radio-button [value]="true">Expense</mat-radio-button>

View file

@ -3,13 +3,13 @@
</div>
<div [hidden]="!currentTransaction" *ngIf="currentTransaction" class="form transaction-form">
<mat-form-field>
<input matInput [(ngModel)]="currentTransaction.title" placeholder="Name" required>
<input matInput [(ngModel)]="currentTransaction.title" placeholder="Name" required autocapitalize="words">
</mat-form-field>
<mat-form-field>
<textarea matInput [(ngModel)]="currentTransaction.description" placeholder="Description"></textarea>
<textarea matInput [(ngModel)]="currentTransaction.description" placeholder="Description" autocapitalize="sentences"></textarea>
</mat-form-field>
<mat-form-field>
<input matInput type="text" [(ngModel)]="currentTransaction.amount" placeholder="Amount" required>
<input matInput type="number" [(ngModel)]="currentTransaction.amount" placeholder="Amount" required step="0.01">
</mat-form-field>
<mat-form-field>
<input matInput type="date" [ngModel]="transactionDate | date:'yyyy-MM-dd'"

View file

@ -18,7 +18,6 @@ export class AddEditTransactionComponent implements OnInit, OnChanges {
@Input() create: boolean
public transactionType = TransactionType;
public categories: Category[];
public rawAmount: string;
public currentTime: string;
public transactionDate: string;