File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 403403 // When new files are added, simply append them to the overall list
404404 var $ = this ;
405405 input . addEventListener ( 'change' , function ( e ) {
406- $ . addFiles ( e . target . files , e ) ;
407- e . target . value = '' ;
406+ if ( e . target . value ) {
407+ $ . addFiles ( e . target . files , e ) ;
408+ e . target . value = '' ;
409+ }
408410 } , false ) ;
409411 } , this ) ;
410412 } ,
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ describe('setup', function() {
6969 var event = document . createEvent ( 'MouseEvents' ) ;
7070 event . initEvent ( 'change' , true , true ) ;
7171 input . dispatchEvent ( event ) ;
72- expect ( addFiles ) . toHaveBeenCalled ( ) ;
72+ expect ( addFiles ) . not . toHaveBeenCalled ( ) ;
7373 } ) ;
7474
7575 it ( 'assign to div' , function ( ) {
@@ -83,7 +83,7 @@ describe('setup', function() {
8383 var event = document . createEvent ( 'MouseEvents' ) ;
8484 event . initEvent ( 'change' , true , true ) ;
8585 input . dispatchEvent ( event ) ;
86- expect ( addFiles ) . toHaveBeenCalled ( ) ;
86+ expect ( addFiles ) . not . toHaveBeenCalled ( ) ;
8787 } ) ;
8888
8989 it ( 'single file' , function ( ) {
@@ -120,4 +120,4 @@ describe('setup', function() {
120120 } ) ;
121121 } ) ;
122122
123- } ) ;
123+ } ) ;
You can’t perform that action at this time.
0 commit comments