Merge branch 'RED-7275' into 'master'
RED-7275: Fixed enter. See merge request redactmanager/red-ui!45
This commit is contained in:
commit
337654eb1c
@ -80,6 +80,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
|
|||||||
@HostListener('document:click', ['$event'])
|
@HostListener('document:click', ['$event'])
|
||||||
clickOutside($event: MouseEvent) {
|
clickOutside($event: MouseEvent) {
|
||||||
const clickCalendarCell = ($event.target as HTMLElement).classList?.contains('mat-calendar-body-cell-content');
|
const clickCalendarCell = ($event.target as HTMLElement).classList?.contains('mat-calendar-body-cell-content');
|
||||||
|
if (this.isDate) {
|
||||||
|
this.#focusOnEditInput();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isInEditMode && this.closedDatepicker && !clickCalendarCell) {
|
if (this.isInEditMode && this.closedDatepicker && !clickCalendarCell) {
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
@ -201,7 +205,9 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
|
|||||||
|
|
||||||
#focusOnEditInput(): void {
|
#focusOnEditInput(): void {
|
||||||
setTimeout(() => {
|
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();
|
input?.focus();
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user