Double image after replacing result in onImageUploadBefore
See original GitHub issueWhen I use onImageUploadBefore to upload an image and return new result object, I get two images in the editor, one with the updated image URL from the upload function and one that is base64.
How do I prevent the second, base64 image from showing?
Here’s a rough code example of what I am doing
onImageUploadBefore: async (files: File[], info: object, uploadHandler: Function) => {
let fileName = await helpers.ddddd(files[0]);
let res = {
"result": [{ "url": fileName, "name": files[0].name, "size": files[0].size },]
};
uploadHandler(res);
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Double image after replacing result in onImageUploadBefore
When I use onImageUploadBefore to upload an image and return new result object, I get two images in the editor, one with the...
Read more >SOLVED: How to fix double image - Vizio Television - iFixit
Redjude Cadornigara most double images are caused by a GATE TAB bond failure. For that, you will have to check the thin orange...
Read more >suneditor/README.md - UNPKG
97, When you display a document created by suneditor ... 113, import image from 'suneditor/src/plugins/dialog/link' ... 453, {text: 'Double', value: 2}.
Read more >Suneditor - npm.io
The Suneditor is a lightweight, flexible, customizable WYSIWYG text editor for your web applications. Pasting from Microsoft Word and Excel.
Read more >suneditor - npm
When you display a document created by suneditor You need to ... import image from 'suneditor/src/plugins/dialog/link' import list from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you
I have done this to solve my issue.
I removed imageUploadUrl and change onImageUploadBefore to synchronize with async function
Thank you for all your help and time
@svermaak @quanlatoi If undefined is returned, it waits until
uploadHandler
is executed. Dont’t usingasync function
. If usedasync function
that the promise object is returned and the basic functions of the editor are executed.