File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -175,19 +175,23 @@ export class AppComponent {
175175 apiKey: ' free' , // Get API keys from: www.bytescale.com
176176 multi: false
177177 };
178- // 'onUpdate' vs 'onComplete' attrs on 'upload-dropzone':
179- // - Dropzones are non-terminal by default (they don't have an end
180- // state), so by default we use 'onUpdate' instead of 'onComplete'.
181- // - To create a terminal dropzone, use the 'onComplete' attribute
182- // instead and add the 'showFinishButton: true' option.
183- onUpdate = (event : UploadWidgetOnUpdateEvent ) => {
184- alert (event .uploadedFiles .map (x => x .fileUrl ).join (" \n " ));
178+ onUpdate = ({ uploadedFiles , pendingFiles }: UploadWidgetOnUpdateEvent ) => {
179+ const uploadedFileUrls = uploadedFiles .map (x => x .fileUrl ).join (" \n " );
180+ console .log (uploadedFileUrls );
185181 };
186182 width = " 600px" ;
187183 height = " 375px" ;
188184}
189185```
190186
187+ > ** Special behaviour for dropzones:**
188+ >
189+ > ` onComplete ` only fires when ` showFinishButton = true ` (i.e. when the user clicks "Finish").
190+ >
191+ > ` onUpdate ` must be used when ` showFinishButton = false ` .
192+ >
193+ > Default value: ` showFinishButton = false `
194+
191195## Result
192196
193197The callbacks receive a ` Array<UploadWidgetResult> ` :
You can’t perform that action at this time.
0 commit comments