Opened 11 years ago

Last modified 10 years ago

#11491 confirmed Bug

Pressing delete key in highlighted text in blockquote removes paragraph tags

Reported by: Packs Owned by:
Priority: Normal Milestone:
Component: Core : Editable Version: 3.0
Keywords: Firefox IE Cc:

Description

If you create a blockquote, enter some text, highlight the text and then press the Delete key. The paragraph(s) inside the blockquote disappear and you can type directly into it.

For FF you need more than one line of text highlighted.

Attachments (1)

IE8.png (15.7 KB) - added by Packs 11 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by Jakub Ś

Keywords: Firefox added; Blockquote removed
Status: newconfirmed
Version: 4.3.23.0

I was able to reproduce this problem only in Firefox from CKEditor 3.0.

I wasn't able however to reproduce it in any other browser.

@Packs if this is reproducible in other browsers please provide screen-cast and/or step by step scenario allowing reproducing this problem in CKEditor demo page.

Changed 11 years ago by Packs

Attachment: IE8.png added

comment:2 Changed 11 years ago by Packs

With IE8, you need to have a paragraph below the blockquote, and select the contents left to right, e.g. with SHIFT+END

comment:3 Changed 11 years ago by Jakub Ś

Keywords: IE added

@Packs you are right, with your TC this problem can be reproduced in IE8-10. IE 11 seems to work fine here.

comment:4 Changed 10 years ago by Aleksey

Hello guys, is there any solution to prevent paragraph tags being removed after removing all editable content? (FF issue at least as I remember)

comment:5 Changed 10 years ago by Jakub Ś

No one is working on this ticket at the moment and I can't see any way to bring back the paragraph. Sorry.

Try below. Perhaps that code or something like that might work:

editor.on( "pluginsLoaded", function( event ){
	editor.on( 'contentDom', function() {
		var editable = editor.editable();					
		editable.attachListener( editable, 'keyup', function( e ) { 
			if( e.data.getKeystroke() == 46 ) {
				var elem = editor.elementPath().lastElement;							
				if( elem.getName() == 'blockquote' ) {
					var emptyP = new CKEDITOR.dom.element( 'p' );
					emptyP.appendBogus(); 
					emptyP.appendTo( elem );
							

					var range = editor.createRange(); 
					range.moveToPosition( emptyP, CKEDITOR.POSITION_AFTER_START );
					editor.getSelection().selectRanges( [ range ] ); 
				}
			}
		}, null, null, 100 );
	});
});
Last edited 10 years ago by Jakub Ś (previous) (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy