julianpoemp / ngx-jodit

Angular wrapper for jodit and jodit-pro WYSIWYG editor supporting Angular >=12 and ESM.
https://github.julianpoemp.com/ngx-jodit/3.x/
MIT License
17 stars 4 forks source link

ngx-jodit-pro: Delete image error #16

Closed Yang-Jing-Hui closed 11 months ago

Yang-Jing-Hui commented 11 months ago

If you use the Delete key on the keyboard to delete a picture, an error will occur.

image

global-error-handler.ts:46 TypeError: Node element must be in editor at n (node_modules\jodit-pro\build\jodit.js:1:60738) at ne.select (node_modules\jodit-pro\build\jodit.js:1:98880) at Ot.onDelete (node_modules\jodit-pro\build\jodit.js:1:369297) at HTMLDivElement. (node_modules\jodit-pro\build\jodit.js:1:366382) at HTMLDivElement.g (node_modules\jodit-pro\build\jodit.js:1:30503) at _ZoneDelegate.invokeTask (zone.js:406:1) at Object.onInvokeTask (core.mjs:25595:1) at _ZoneDelegate.invokeTask (zone.js:405:1) at Zone.runTask (zone.js:178:1) at ZoneTask.invokeTask [as invoke] (zone.js:487:1)

This seems to be a bug of jodit-pro, but it does not appear when I run the jodit-pro demo.

Package versions: "@angular/animations": "13.3.11", "@angular/cdk": "13.3.9", "@angular/common": "13.3.11", "@angular/compiler": "13.3.11", "@angular/core": "13.3.11", "jodit": "^3.24.9", "jodit-pro": "^1.3.40", "ngx-jodit-pro": "^1.0.6",

julianpoemp commented 11 months ago

@Yang-Jing-Hui the official demo uses Jodit Pro Beta 2. Unfortunately I can't reproduce this issue using my demo-pro application and Jodit-Pro 1. Can You please explain each step you've taken to get this error? How did you insert the picture before?

important: Please add the expanded error from the web console (with as many lines as possible)

julianpoemp commented 11 months ago

@Yang-Jing-Hui I created an Demo Stackblitz project. Perhaps you can reproduce the issue there (don't add your license key): https://stackblitz.com/edit/stackblitz-starters-bic4kq

Yang-Jing-Hui commented 11 months ago

I used Microsoft Paint to select and copy the image, and then pasted it into the jodit editor. Select the picture I just pasted in the jodit editor and press the Delete key on the keyboard. If you use the Backspace key on the keyboard, no error will be reported, but Delete will report an error. image image

Yang-Jing-Hui commented 11 months ago

I think it is jodit-pro issue. Reference

Thank you very much~~

julianpoemp commented 11 months ago

@Yang-Jing-Hui Yes, it's an Jodit-Pro issue. Closing this.