Opened 12 years ago
Last modified 10 years ago
#10555 confirmed Bug
It is not possible to catch key event when deleting list
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 |
Keywords: | Cc: |
Description (last modified by )
- Setup editor
var editor = CKEDITOR.replace( 'editor1' ); editor.on( 'pluginsLoaded', function( evt ) { editor.on( 'contentDom', function( e ) { var editable = editor.editable(); var doc = editor.document; var wasKeyboardAlreadyUsed = false; editable.attachListener( doc, 'keydown', function( event ) { console.log('key'); }); }); });
- Open page and insert list into editor
- Select whole list with mouse and press delete or backspace.
Result: key event isn't caught.
Problem can be reproduced from CKEditor 4.0.
This issue was reported on our support channel.
Change History (6)
comment:1 Changed 12 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
I have just checked this issue:
- Open sample page and clear everything with new page command
- Create a list - key is logged
- Select list with Ctrl+A or with a mouse
- Press delete or backspace
Results: keydown isn't caught when list is deleted but keyup is
comment:4 Changed 11 years ago by
Its a very important use case for me. Since CKEditor does not provide API to make a element non editable or mandatory (however selectable), I need to trap delete key so that user cannot delete the list item. Since the keydown event is not working, I cannot intercept delete key and restrict user from deleting the list. There is no use of intercepting keyup event as delete key is already executed. Please take this in next release
comment:5 Changed 11 years ago by
Description: | modified (diff) |
---|
comment:6 Changed 10 years ago by
can someone tell me how to handle this situation? Having same issue. Downloaded source code and debug the code, onkeydown ck-editor cancel this event. Is there anyway i can prevent deleting <li>?
Thanks in advance.
Another TC:
Insert below code, put cursor behind "ipsum" and press delete.