-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 BR before widget deletes widget #4720
Comments
I can confirm that |
I have retested and found that with a break before an inline widget, if you try to delete the break the widget is deleted but the break is not. For an example go to https://ckeditor.com/docs/ckeditor4/latest/examples/draganddrop.html |
It's been a while since we last heard from you. We are marking this issue as stale due to inactivity. Please provide the requested feedback or the issue will be closed after next 7 days. |
Please do not close this issue. I provided additional info and steps to reproduce. I even provided a possible fix. What else do you need? |
I'm sorry for delay in responding. Yes, you're right, I was able to reproduce the issue using the scenario you provided. I'm marking the issue as confirmed so our bot won't close it or mark it stale. |
Are you sure? I wrote a manual test and the BR element is removed after hitting two times the del key. The first hit creates a hidden selection element. |
btw, the issue is present since 4.3.1. Not related to PR #4433 |
@bunglegrind Yes you have to either hit delete twice or hit the right arrow key once so that the BR is listed in the breadcrumbs and then hit delete. that is not perfect but it is still preferable to what it used to do . |
My opinion - as a humble contributor - concerning this issue:
|
Steps to reproduce
Hit the delete key with the cursor before a BR element that is before a widget.
Expected result
BR element should be removed
Actual result
The BR element AND the widget after it are removed
Other details
This is similar to the problem as reported in ticket 1572 where the poster reports that an empty P element cannot be deleted before a widget. That issue was fixed in 4.16.1 by modifying selection.js file in the getOnKeyDownListener function.
Fix
I found that by modifying ckeditor 4.17 - selection.js - getOnKeyDownListener function by replacing
if ( next && next.type == CKEDITOR.NODE_ELEMENT && next.getAttribute( 'contenteditable' ) == 'false' )
with
if ( next && next.type == CKEDITOR.NODE_ELEMENT && next.getAttribute( 'contenteditable' ) != 'true' )
fixed the problem because next.getAttribute( 'contenteditable' ) returns null for the BR element
This had the added benefit of displaying the BR element in the breadcrumbs.
The text was updated successfully, but these errors were encountered: