Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a widget with the keyboard removes the whole body #5125

Closed
transporthummel opened this issue Mar 14, 2022 · 2 comments · Fixed by #5170
Closed

Deleting a widget with the keyboard removes the whole body #5125

transporthummel opened this issue Mar 14, 2022 · 2 comments · Fixed by #5170
Assignees
Labels
plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@transporthummel
Copy link

transporthummel commented Mar 14, 2022

Bug

Since CKEditor version 4.16.1, deleting a widget using the keyboard (BACKSPACE or DELETE) can lead to the whole document body element being removed. Unsurprisingly, the editor isn't usable anymore after that.

For reproduction purposes, the JSFiddle sample below adds a very simple widget consisting of just one img tag. Just place the cursor behind the "deleteme" text and then delete the text and the image using BACKSPACE. When CKEditor determines the next element to apply the "fake selection" to, the outcome will be the body, which will then be removed.
According to my own investigation, this was probably caused by the fix done in #1572.

The error is still there in the latest version. In 4.16.0 it still works fine.

http://jsfiddle.net/transporthummel/xnm3sebc/5/

Expected result

The widget is selected by the fake selection and then removed.

Actual result

Instead of selecting the widget, the document body is removed, making the editor unusable.

@transporthummel transporthummel added the type:bug A bug. label Mar 14, 2022
@Comandeer Comandeer added status:confirmed An issue confirmed by the development team. plugin:widget The plugin which probably causes the issue. size:? labels Mar 14, 2022
@Comandeer
Copy link
Member

I can confirm the issue. It seems that your investigation was right, the commit 1152d32 appears to be the culprit.

@CKEditorBot
Copy link
Collaborator

Closed in #5170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants