#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)
Change History (8)
Changed 10 years ago by
Attachment: | screenrecording.GIF added |
---|
Changed 10 years ago by
Attachment: | inlinebycode3.html added |
---|
comment:1 Changed 10 years ago by
Status: | new → confirmed |
---|---|
Summary: | Inline editing setting tabSpaces>0 : lose text formatting with tab key → Setting 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 10 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 10 years ago by
Status: | assigned → review |
---|
Pushed branch:t/12157 with tests and a patch.
comment:4 Changed 10 years ago by
Milestone: | → CKEditor 4.4.7 |
---|
comment:5 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | review → closed |
Merged into master in git:ec78f62.
comment:6 Changed 10 years ago by
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.
screen recording of issue