Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h1 mat-dialog-title class="dialog-icon-title">
<form [formGroup]="noteDialogForm">
<mat-form-field class="full-width" appearance="outline">
<mat-label>{{ t("your_comment") }}</mat-label>
<textarea matInput formControlName="comment"></textarea>
<textarea matInput formControlName="comment" cdkFocusInitial></textarea>
<mat-error>{{ t("required") }}</mat-error>
</mat-form-field>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ describe('NoteDialogComponent', () => {
expect(env.flagIcon).toEqual('/assets/icons/TagIcons/' + SF_TAG_ICON + '.png');
}));

it('focuses the comment textarea when the thread already has notes', fakeAsync(() => {
env = new TestEnvironment({ noteThread: TestEnvironment.getNoteThread() });
expect(env.notes.length).toBeGreaterThan(0);
expect(document.activeElement).toBe(env.noteInputElement.nativeElement);
}));

it('does not save note if textarea is empty', fakeAsync(() => {
env = new TestEnvironment({ verseRef: new VerseRef('MAT 1:1') });
expect(env.noteInputElement).toBeTruthy();
Expand Down
Loading