File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -543,9 +543,12 @@ function initIssueTemplateCommentEditors(commentForm: HTMLFormElement) {
543543 showElem ( commentForm . querySelectorAll ( '.combo-editor-dropzone .form-field-real' ) ) ;
544544 hideElem ( commentForm . querySelectorAll ( '.combo-editor-dropzone .combo-markdown-editor' ) ) ;
545545 queryElems ( commentForm , '.combo-editor-dropzone .form-field-dropzone' , ( dropzoneContainer ) => {
546- const dropzone = dropzoneContainer . closest ( '.combo-editor-dropzone' ) ?. querySelector ( '.dropzone' ) ;
547- const hasUploadedFiles = dropzone ?. querySelector ( '.dz-preview' ) !== null ;
548- if ( ! hasUploadedFiles ) hideElem ( dropzoneContainer ) ;
546+ const dropzoneEl = dropzoneContainer . closest < HTMLElement > ( '.combo-editor-dropzone' ) ?. querySelector < HTMLElement > ( '.dropzone' ) ;
547+ const dzInstance = dropzoneEl ?. dropzone ;
548+
549+ if ( dzInstance && dzInstance . files . length === 0 ) {
550+ hideElem ( dropzoneContainer ) ;
551+ }
549552 } ) ;
550553
551554 // activate this markdown editor
You can’t perform that action at this time.
0 commit comments