Opened 9 years ago
Last modified 8 years ago
#13775 confirmed Bug
Typing into selected contents of span tag creates font tag
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 |
Keywords: | IE11 Blink Webkit | Cc: |
Description (last modified by )
Steps to reproduce
- Open replacebycode sample and clear editor contents
- Type few characters
- Select chars and change text color and font to e.g. Comic sans
- While whole text is still selected (you can also unselect and select whole sample text again - result will be the same), type new random characters
Expected result
Span tags stays and only its content changes.
Actual result
Span tag is changed to font tag.
Other details (browser, OS, CKEditor version, installed plugins)
Problem can be reproduced from CKEditor 4.0 in Blink/Webkit and in IE11 from version 4.3 (this is the version when we have started supporting IE11 and issue probably occurs in earlier versions as well). Firefox and IE10- seem to work fine.
Change History (11)
comment:1 Changed 9 years ago by
Status: | new → confirmed |
---|---|
Summary: | Typing into selected area ccontents of span tag creates font tag → Typing into selected contents of span tag creates font tag |
comment:3 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Keywords: | Blink Webkit added |
Version: | 4.3 → 4.0 |
comment:5 Changed 8 years ago by
Description: | modified (diff) |
---|
This seems to be IE native issue, if you try below code:
<div style="margin:20px; border:1px solid black; width:500px;" contenteditable="true"> <strong>test</strong> </div>
select all and press e.g. c
character, you will get c
wrapped in b
tags; The same will happen if you place cursor behind test^
, press backspace 4 times and then start typing.
comment:6 Changed 8 years ago by
This bug is not native to IE. I'm experiencing it in the latest version of Google Chrome.
comment:7 Changed 8 years ago by
@elkrocke I have tested latest Chrome 55.0.2883.87 and CKFinder 4.6.0 but no issue has occurred for me. Could you tell me what are the exact steps to get font tags in Chrome? Could your perhaps provide a screen cast showing how to reproduce in demo page?
comment:8 Changed 8 years ago by
You may find my comment in #14302#comment:3 helpful. Following the scenario described there I am only able to reproduce the bug on Edge/IE. Also I tried with plain contenteditable but it behaves correctly so it does not seem like the native IE issue.
The scenario from comment mentioned earlier:
- Go to http://sdk.ckeditor.com/samples/acf.html to Disabling ACF sample.
- In the source mode paste HTML
<p><span style="font-size:18px;color:#00FF00;background-color: #FFFF00">Text</span></p>
- Switch back to WYSIWYG mode.
- Select whole
Text
. - Type something.
Resulted html is:
<p><font color="#00ff00" style="background-color: rgb(255, 255, 0);">Typed text</font></p>
It also seems that ACF does not have any effect on this issue, e.g. config.allowedContent = 'span[*](*){*}';
does not help.
comment:9 Changed 8 years ago by
This issue is caused by the part of the fixDom
method - https://github.com/ckeditor/ckeditor-dev/blob/master/core/editable.js#L1361.
comment:10 Changed 8 years ago by
As a previous comment stated, what triggers the issue is bogus br inserted in the fixDom
method, however it is not the direct cause of the issue.
comment:11 Changed 8 years ago by
So the cause of this issue is br
element after span
element:
<p><span>bar</span><br></p>
and with such HTML it occurs also in plain contenteditable which means is is native IE bug. See http://codepen.io/f1ames/pen/YNjORa.
As a workaround ACF transformations might be used: