Open Seongseokwon opened 1 year ago
Did you find a solution to this issue? I have the same problem. Am trying to use onImageUpload
Callback and it is not working.
Your callback is never called, because the directive overrides the onImageUpload
callback.
I think this is a bug and the directive should respect custom upload functions.
A simple solution would be probably to give priority to user options.
Instead of
options.callbacks = { ...options.callbacks, onImageUpload: files => this.uploadImage(files), onMediaDelete: files => this.mediaDelete.emit({ url: $(files[0]).attr('src') }) };
Reorder to
options.callbacks = { onImageUpload: files => this.uploadImage(files), onMediaDelete: files => this.mediaDelete.emit({ url: $(files[0]).attr('src') }), ...options.callbacks, };
I want to use the image upload event, but how should I do it?
i tried this
config: SummernoteOptions = { ...NOTICE_POPUP_SUMMERNOTE_CONFIG, callbacks: { onImageUpload: function(e: any) { console.log(e); } }, };
but onImageUpload is not working