mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
focus dialog on files added (#5124)
This commit is contained in:
committed by
Eugenio Romano
parent
6857213db6
commit
b637cea059
@@ -88,6 +88,26 @@ describe('FileUploadingDialogComponent', () => {
|
|||||||
expect(document.activeElement.id).toBe('upload-dialog');
|
expect(document.activeElement.id).toBe('upload-dialog');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should refocus on dialog when uploading another file', fakeAsync(() => {
|
||||||
|
uploadService.addToQueue(...fileList);
|
||||||
|
uploadService.uploadFilesInTheQueue(emitter);
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
tick(100);
|
||||||
|
|
||||||
|
(document.querySelector('#upload-dialog') as HTMLElement).blur();
|
||||||
|
|
||||||
|
expect(document.activeElement.id).not.toBe('upload-dialog');
|
||||||
|
|
||||||
|
uploadService.addToQueue(...fileList);
|
||||||
|
uploadService.uploadFilesInTheQueue(emitter);
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
tick(100);
|
||||||
|
|
||||||
|
expect(document.activeElement.id).toBe('upload-dialog');
|
||||||
|
}));
|
||||||
|
|
||||||
it('should update uploading file list', () => {
|
it('should update uploading file list', () => {
|
||||||
uploadService.addToQueue(...fileList);
|
uploadService.addToQueue(...fileList);
|
||||||
uploadService.uploadFilesInTheQueue(emitter);
|
uploadService.uploadFilesInTheQueue(emitter);
|
||||||
|
@@ -98,6 +98,8 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
|||||||
if (this.filesUploadingList.length && !this.isDialogActive) {
|
if (this.filesUploadingList.length && !this.isDialogActive) {
|
||||||
this.isDialogActive = true;
|
this.isDialogActive = true;
|
||||||
this.dialogActive.next();
|
this.dialogActive.next();
|
||||||
|
} else {
|
||||||
|
this.dialogActive.next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user