Hey there!
I'm using jodit-react 1.3.32.
When I use the upload button it works pretty well, the error occurs when I ctrl+v an image, the function defaultHandlerSuccess is being called but dispatch this error:
I tried to find out what could cause this error and I console.log "this" to see what "this" were in each case.
The first one is "this" when I uploaded using the button:
The second one is when I used ctrl+v:
The image is sent to the backend in both cases, the problem is "this" has no selection.insertImage and I dont know how to change.
That's my uploader options:
uploader: { url: myURLHere, isSuccess: function (resp) { return resp; }, buildData: function (data) { const formData = new FormData(); formData.append('image', data.getAll('files[0]')[0]); formData.append( 'article_id', 'd75d3749-ae18-4523-90d7-4770c5420a75' ); return formData; }, defaultHandlerSuccess: function (data) { console.log(this) this.selection.insertImage(data.image); }, process: function (resp) { return { image: resp.image, }; }, error: function (e) { console.log(e); this.e.fire('errorMessage', [e.getMessage(), 'error', 4000]); }, },
Hey there! I'm using jodit-react 1.3.32. When I use the upload button it works pretty well, the error occurs when I ctrl+v an image, the function defaultHandlerSuccess is being called but dispatch this error:![image](https://user-images.githubusercontent.com/86433505/209889628-0dc20d3d-7ca1-4825-9129-3fce101a2d09.png)
I tried to find out what could cause this error and I console.log "this" to see what "this" were in each case. The first one is "this" when I uploaded using the button:![image](https://user-images.githubusercontent.com/86433505/209889788-746c0572-bafa-4cdb-af3a-7b022df7e82c.png)
The second one is when I used ctrl+v:![image](https://user-images.githubusercontent.com/86433505/209889757-9031351c-e851-4399-aba2-1778df4a148f.png)
The image is sent to the backend in both cases, the problem is "this" has no selection.insertImage and I dont know how to change.
That's my uploader options:
uploader: { url: myURLHere, isSuccess: function (resp) { return resp; }, buildData: function (data) { const formData = new FormData(); formData.append('image', data.getAll('files[0]')[0]); formData.append( 'article_id', 'd75d3749-ae18-4523-90d7-4770c5420a75' ); return formData; }, defaultHandlerSuccess: function (data) { console.log(this) this.selection.insertImage(data.image); }, process: function (resp) { return { image: resp.image, }; }, error: function (e) { console.log(e); this.e.fire('errorMessage', [e.getMessage(), 'error', 4000]); }, },