Opened 7 years ago

Closed 6 years ago

Last modified 2 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: SpellChecker.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 SpellChecker.net 4 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 follow-up: Changed 7 years ago by garry.yao

  • Cc SpellChecker.net added
  • Keywords Confirmed added; scayt IsDirty ResetIsDirty removed
  • Milestone set to 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 7 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 6 years ago by fredck

  • Milestone changed from CKEditor 3.2 to CKEditor 3.x

comment:4 Changed 6 years ago by SpellChecker.net

  • Resolution set to fixed
  • Status changed from new to closed

patch is submitted in #5145

comment:5 Changed 6 years ago by fredck

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 6 years ago by SpellChecker.net

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

comment:7 Changed 6 years ago by fredck

  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed with [5324].

comment:8 Changed 6 years ago by fredck

  • Milestone changed from CKEditor 3.x to CKEditor 3.3

Changed 4 years ago by SpellChecker.net

comment:9 Changed 4 years ago by SpellChecker.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 4 years ago by SpellChecker.net

  • Keywords HasPatch ?Review added

comment:11 Changed 4 years ago by j.swiderski

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

comment:12 Changed 2 years ago by wwalc

  • Keywords ?Review removed
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy