Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#12157 closed Bug (fixed)

Setting tabSpaces>0 : lose text formatting with tab key

Reported by: Joe Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.4.7
Component: General Version: 4.0 Beta
Keywords: Cc:

Description

The text formatting is lost when pressing the tab key and tabSpaces > 0. You can see this in the sample inlinebycode.html

add tabSpaces :

// We need to turn off the automatic editor creation first.
CKEDITOR.disableAutoInline = true;
CKEDITOR.tabSpaces = 4;
CKEDITOR.on( 'instanceReady', function( ev ) {

Format text, type in text, hit tab, type some more, formatting lost.

Firefox & Chrome didn't try IE

Would expect formatting to be kept if tab key pressed.

Attachments (2)

screenrecording.GIF (189.8 KB) - added by Joe 10 years ago.
screen recording of issue
inlinebycode3.html (1.8 KB) - added by Jakub Ś 10 years ago.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by Joe

Attachment: screenrecording.GIF added

screen recording of issue

Changed 10 years ago by Jakub Ś

Attachment: inlinebycode3.html added

comment:1 Changed 10 years ago by Jakub Ś

Status: newconfirmed
Summary: Inline editing setting tabSpaces>0 : lose text formatting with tab keySetting tabSpaces>0 : lose text formatting with tab key
Version: 4.0 Beta

Problem can be reproduce from CKEditor 4.0 beta. It works fine in CKEditor 3.x.

You don't need inline editor to reproduce this issue. It is also possible to get this result in classic editor.

comment:2 Changed 9 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:3 Changed 9 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed branch:t/12157 with tests and a patch.

comment:4 Changed 9 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.7

comment:5 Changed 9 years ago by Artur Delura

Resolution: fixed
Status: reviewclosed

Merged into master in git:ec78f62.

comment:6 Changed 9 years ago by Piotrek Koszuliński

A few words of explanation - the tab plugin used the editor.insertHtml method which (it's a design decision that we made) assumes that the HTML to be inserted already contains all information about semantics/styling and this information must be preserved when inserting it. In this case we're inserting HTML representing N spaces. N unstyled spaces.

The editor.insertText method which I proposed works slightly differently. Since it accepts a plain text, which cannot contain information about styling or semantics, the styling and semantics of the place of insertion is preserved.

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