Merge branch 'RED-7275' into 'master'

RED-7275: Fixed enter.

See merge request redactmanager/red-ui!45
This commit is contained in:
Dan Percic 2023-09-01 14:47:42 +02:00
commit 337654eb1c

View File

@ -80,6 +80,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
@HostListener('document:click', ['$event'])
clickOutside($event: MouseEvent) {
const clickCalendarCell = ($event.target as HTMLElement).classList?.contains('mat-calendar-body-cell-content');
if (this.isDate) {
this.#focusOnEditInput();
}
if (this.isInEditMode && this.closedDatepicker && !clickCalendarCell) {
this.close();
}
@ -201,7 +205,9 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
#focusOnEditInput(): void {
setTimeout(() => {
const input = document.getElementById(this.fileAttribute.id);
const input = document.getElementById(this.fileAttribute.id) as HTMLInputElement;
const end = input.value.length;
input?.setSelectionRange(end, end);
input?.focus();
}, 100);
}