@@ -652,12 +652,25 @@ class FileUploader extends Editor<FileUploaderProperties> {
652652 }
653653
654654 this . $element ( ) . toggleClass ( FILEUPLOADER_SHOW_FILE_LIST_CLASS , showFileList ) ;
655+ this . _toggleFileContainerAria ( Boolean ( showFileList && this . _files ?. length ) ) ;
655656 this . _toggleFileUploaderEmptyClassName ( ) ;
656657 this . _updateFileNameMaxWidth ( ) ;
657658
658659 this . _validationMessage ?. repaint ( ) ;
659660 }
660661
662+ _toggleFileContainerAria ( applyAria : boolean ) : void {
663+ const aria = {
664+ role : applyAria ? 'list' : null ,
665+ 'aria-label' : applyAria
666+ ? messageLocalization . format ( 'dxFileUploader-fileListLabel' )
667+ : null ,
668+ } ;
669+
670+ // @ts -expect-error attr type should be extdened
671+ this . _$filesContainer ?. attr ( aria ) ;
672+ }
673+
661674 _renderFile ( file : FileUploaderItem ) : void {
662675 const { value } = file ;
663676
@@ -667,7 +680,8 @@ class FileUploader extends Editor<FileUploaderProperties> {
667680
668681 const $fileContainer = $ ( '<div>' )
669682 . addClass ( FILEUPLOADER_FILE_CONTAINER_CLASS )
670- . appendTo ( this . _$filesContainer ) ;
683+ . appendTo ( this . _$filesContainer )
684+ . attr ( 'role' , 'listitem' ) ;
671685
672686 this . _renderFileIcon ( value . name , $fileContainer ) ;
673687
@@ -800,6 +814,10 @@ class FileUploader extends Editor<FileUploaderProperties> {
800814 integrationOptions : { } ,
801815 hoverStateEnabled,
802816 stylingMode : _buttonStylingMode ,
817+ elementAttr : {
818+ // @ts -expect-error foramat params should be extended
819+ 'aria-label' : messageLocalization . format ( 'dxFileUploader-removeFileButtonLabel' , file ?. value ?. name ?? '' ) ,
820+ } ,
803821 } ,
804822 ) ;
805823
@@ -825,6 +843,10 @@ class FileUploader extends Editor<FileUploaderProperties> {
825843 icon : 'upload' ,
826844 hoverStateEnabled,
827845 stylingMode : _buttonStylingMode ,
846+ elementAttr : {
847+ // @ts -expect-error foramat params should be extended
848+ 'aria-label' : messageLocalization . format ( 'dxFileUploader-uploadFileButtonLabel' , file ?. value ?. name ?? '' ) ,
849+ } ,
828850 } ,
829851 ) ;
830852
@@ -859,6 +881,10 @@ class FileUploader extends Editor<FileUploaderProperties> {
859881 this . option ( { value : valueCopy } ) ;
860882 this . _preventRecreatingFiles = false ;
861883
884+ if ( this . _files ?. length === 0 ) {
885+ this . _toggleFileContainerAria ( false ) ;
886+ }
887+
862888 this . _toggleFileUploaderEmptyClassName ( ) ;
863889 this . _resetInputValue ( true ) ;
864890 }
0 commit comments