Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#4688 closed Bug (fixed)

SCAYT affecting IsDirty and ResetIsDirty.

Reported by: irpf Owned by:
Priority: Normal Milestone: CKEditor 3.3
Component: UI : Spell Checker Version: FCKeditor 2.6.5
Keywords: Confirmed, HasPatch Cc: WebSpellChecker.net

Description

Using 2.6.5. Windows NT. FireFox 3.0.15.

There seems to be some kind of timing/race condition that causes ResetIsDirty to fail (or causes something else to come along later, after ResetIsDirty has been called, and flags the editor as "dirty") if 1) SCAYT is enabled and 2) there is at least one misspelled word somewhere within the editor text (highlighted with a red underline).

The specific scenario involves retrieving the editor contents (HTML) from a database and setting it into the editor via SetText. Obviously, I don't want this newly retrieved text to be considered "changed/dirty" (from the user's perspective) so within the OnAfterSetHTML handler I invoke ResetIsDirty. This works perfectly and reliably...UNLESS the conditions mentioned above are present. In the SCAYT scenario, the invocation of ResetIsDirty that occurs within OnAfterSetHTML seems to be ignored or something else comes along after it's invoked and marks the editor as dirty, perhaps as a result of the slight delay introduced by the spell check operation that eventually marks the incorrect word with the red underline. The end result is that the editor says it is Dirty even though no editing of the text has occurred.

Thank you.

Attachments (1)

4688.patch (2.0 KB) - added by WebSpellChecker.net 12 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 14 years ago by Garry Yao

Cc: WebSpellChecker.net added
Keywords: Confirmed added; scayt IsDirty ResetIsDirty removed
Milestone: CKEditor 3.2

Confirmed with v3 also, I would ask SpellChecker.net to invoke the restore dirty logic at the proper place:

	// DOM modification should not bother dirty flag.
	function restoreDirty( editor )
	{
		if( !editor.checkDirty() )
			setTimeout( function(){ editor.resetDirty(); } );
	}

comment:2 in reply to:  1 Changed 14 years ago by irpf

Hi. Is there a general timeframe on when a fix for this might be released? (Or a suggested workaround until such a fix becomes available?)

Many thanks.

comment:3 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.2CKEditor 3.x

comment:4 Changed 14 years ago by WebSpellChecker.net

Resolution: fixed
Status: newclosed

patch is submitted in #5145

comment:5 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: closedreopened

It's ok to indicate that this one is supposed to be fixed by another tickets, but it should be closed only after confirming the fix one the relative ticket gets closed.

comment:6 Changed 14 years ago by WebSpellChecker.net

This bug completely addressed in patch, added in #5288 ticket.

comment:7 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: reopenedclosed

Fixed with [5324].

comment:8 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.xCKEditor 3.3

Changed 12 years ago by WebSpellChecker.net

Attachment: 4688.patch added

comment:9 Changed 12 years ago by WebSpellChecker.net

WebSpellChecker team has been reported CheckDirty functionality doesn't work correctly after replacing misspellings with correct word. While preparing solution we discovered additional problem in IE. Here are steps to reproduce:

  1. Open http://ckeditor.com/demo in IE9
  2. Enable SCAYT and wait for all misspellings would be underlined
  3. Change editor's mode to <Source> then to <WYSIWYG>
  4. Run in console CKEDITOR.instances.editor1.checkDirty()

Expected result: checkDirty=false

Actual result: checkDirty=true

We propose to reopen the ticket because the patch which was initially fixes the problem is the reason for described behavior in IE.

comment:10 Changed 12 years ago by WebSpellChecker.net

Keywords: HasPatch ?Review added

comment:11 Changed 12 years ago by Jakub Ś

SpellChecker.net we have opened new ticket for this TC you have reported #9161.

comment:12 Changed 10 years ago by Wiktor Walc

Keywords: ?Review removed
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