Opened 16 years ago

Closed 11 years ago

#1495 closed Bug (fixed)

[FF] oEditor.IsDirty not handling spaces and CR correctly (in some cases)

Reported by: bongobongo Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.4.3
Keywords: Firefox Cc:

Description

I'm currently using this to see if content of an FCKeditor has changed

if (oEditor.IsDirty()){ return true; }

START SAMPLE SOURCE

This is a test<br /> <br /> This is another test

* END SAMPLE SOURCE *

IsDirty test mostly works but not allways, on the source above: What I found is this: If I place cursor after "This is another test" (see example source above) and hit spacebar some times, and then backspace to remove them then IsDirty return true. If I do the same after "This is a test" the IsDirty return false.

I also note that I get same result when hitting CR where I previously tried with spaces, and then removing with backspace as for previous tests... and get the same result. And if I (said it before, but anyway).. just add some letters and remove them with backspace after "This is another test" then IsDirty returns false (as it should) ..... weird!!!!

As far as I can see, it looks like this is happening on text that does not have anything (letters, tags) follwing it (in source). If I test on one text string only (with no tags after it), I get the buggy behaviour. If I then add a CR and save the record, and then place cursor after last letter and add and remove spaces and/or CR then it works as expected.

Also found the following: If I place cursor after "This is another test" and hit either spacebar or CR and then backspace to remove the newly inserted spaces or CR, and then click source button to get in source view, and click source button to get in normal view, and then click a link or change URL of the page to trigger my code that uses IsDirty then the bug is gone. So it looks like something is added to the source, which is cleaned up when entering source mode. Weird.

The above was tested in Firefox 2.0.0.7 (have now also tested in IE6 and IE7 and could not reproduce the bugs there).

Also note that I use this in fckconfig.js: FCKConfig.EnterMode = 'br' ; FCKConfig.ShiftEnterMode = 'br' ;

Change History (2)

comment:1 Changed 16 years ago by Wojciech Olchawa

Keywords: Confirmed Firefox added
Summary: oEditor.IsDirty not handling spaces and CR correctly (in some cases)[FF] oEditor.IsDirty not handling spaces and CR correctly (in some cases)

Confirmed in FF using FCKeditor 2.6 and the latest SVN version. Works fine with IE.

comment:2 Changed 11 years ago by Jakub Ś

Resolution: fixed
Status: confirmedclosed

This in no longer an issue in CKEditor.

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