Skip to content

Commit 2b8c34f

Browse files
committed
SF-3276 Highlight text in project select when user clicks the input
1 parent 4d49d36 commit 2b8c34f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/project-select/project-select.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[placeholder]="placeholder"
77
[formControl]="paratextIdControl"
88
[matAutocomplete]="auto"
9-
(click)="inputClicked()"
9+
(click)="inputClicked($event)"
1010
[errorStateMatcher]="matcher"
1111
/>
1212
<mat-error id="invalidSelection">{{ invalidMessage }}</mat-error>

src/SIL.XForge.Scripture/ClientApp/src/app/project-select/project-select.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ export class ProjectSelectComponent implements ControlValueAccessor, OnDestroy {
195195
}
196196
});
197197
}
198-
199-
inputClicked(): void {
198+
inputClicked(event: MouseEvent): void {
200199
this.autocompleteTrigger.openPanel();
200+
const input = event.target as HTMLInputElement;
201+
// Select all the text so the user can begin typing to replace it
202+
input.select();
201203
}
202204

203205
nullableLength(project: SelectableProject[] | null): number {

0 commit comments

Comments
 (0)