File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1111</ head >
1212
1313< body >
14- < mapping-input base-url ="https://matwerk.datamanager.kit.edu:8095/ " maxSize =10 id ="input-component "> </ mapping-input >
14+ < mapping-input base-url ="https://matwerk.datamanager.kit.edu:8095/ " maxSize =a id ="input-component "> </ mapping-input >
1515
1616</ body >
1717
Original file line number Diff line number Diff line change @@ -129,6 +129,10 @@ class MappingInputProvider extends HTMLElement {
129129 const maxSize = this . getAttribute ( ATTRIBUTES [ 1 ] ) ;
130130 if ( maxSize != null ) {
131131 this . maxSize = Number . parseInt ( maxSize ) ;
132+ if ( isNaN ( this . maxSize ) ) {
133+ console . error ( "Invalid maxSize attribute. Setting value to default." )
134+ this . maxSize = 5 ;
135+ }
132136 }
133137
134138 // initialize and connect file uploader
@@ -138,7 +142,7 @@ class MappingInputProvider extends HTMLElement {
138142 FilePondLib . registerPlugin ( FilePondPluginFileValidateSize ) ;
139143 options . credits = false ;
140144 options . maxFiles = 1 ;
141- options . maxFileSize = `${ maxSize } MB` ;
145+ options . maxFileSize = `${ this . maxSize } MB` ;
142146 options . labelIdle = "Drag & Drop your files or <span class=\"filepond--label-action\"> Browse </span><br>" +
143147 `<span class=\"info-small\">(File size is limited to ${ options . maxFileSize } )</span>` ;
144148 this . fileChooser = FilePondLib . create ( filepondElement , options ) ;
You can’t perform that action at this time.
0 commit comments