Opened 10 years ago

Last modified 8 years ago

#12199 confirmed Bug

ckeditor is omitting a single trailing space in firefox and ie.

Reported by: Ravi_SPS Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Cc: dominic@…, rick.schnorenberg@…

Description

i've configured ckeditor inside jquery ui dialogue box text area. My aim is to get the whatever data entered by the user. Including spaces as many as entred by the user. When user enters a space after some text it returning same as mean text+space in chrome. But in FF and IE(IE9,IE11) the space is getting omitted and it is returning only text but not the space which entered at end. If user enters more than one space then the spaces are returning along with text mean text+space(if space are more than one). This behaviour is in FF and IE9,IE11 but not in GChrome. In GChrome it's working as expectdly. Below link may help you http://jsfiddle.net/Ravi_SPS/pBL5G/2/

Change History (4)

comment:1 Changed 10 years ago by Jakub Ś

I’m not sure if this isn’t browser native behaviour. I remember we have few such or similar issues reported e.g. #9978.

I also remember that lately there has been some work done involving introducing custom behaviour to space handling although I can't find any issues describing it thus I'm leaving this ticket open for now so that others could comment on it.

comment:2 Changed 10 years ago by Rick Schnorenberg

I've run into a similar issue that I think shares the same root cause as this issue. If you press the enter key with a single space after your cursor that space is not placed in the new block in IE and Firefox. Here is an example using | to represent the cursor and _ to represent a single whitespace:

Test|_

Pressing enter in Chrome:

Test
|_

Pressing enter in IE or Firefox:

Test_
|

This also happens even if there is a bookmark at the end of the first line:

Test|_<bookmark>

Executing the enter command and then re-selecting the bookmark results in your cursor reappearing on the first line instead of the newly created second line because the space and bookmark are not moved into the new block on IE and Firefox.

comment:3 Changed 10 years ago by Rick Schnorenberg

Cc: rick.schnorenberg@… added

comment:4 Changed 8 years ago by Jakub Ś

Status: newconfirmed
Version: 4.0

You can use API sample to test that. When you type e.g. 'test ' and then use the Get Editor Contents button then <p>test&nbsp;</p> is returned in Chrome and Edge while IE11 and FF only return <p>test</p>. It is not what is happening in native contenteditable elements where IE returns <p>'test '</p> and FF returns <p>'test&nbsp;'</p> (returns with the help of document.getElementById('wrapper').innerHTML).

It is also worth mentioning that when you paste the following code into editor source area <p>test </p> and then switch wysiwyg/source, you will get <p>test</p> in all browsers. White space will be trimmed in every browser in this case.

Last edited 8 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