Opened 9 years ago

Last modified 9 years ago

#12635 confirmed Bug

Keypress show that undo is available despite real undo count

Reported by: Marek Lewandowski Owned by:
Priority: Normal Milestone:
Component: Core : Undo & Redo Version:
Keywords: Cc:

Description (last modified by Marek Lewandowski)

It seems that if I lock the UndoManager for snapshots, keyboard presses will still render undo button to indicate that undo steps are available.

  1. Open any sample with CKEditor. (i.e. samples/replacebyclass.html)
  2. Go to JavaScript console, and enter following code:
CKEDITOR.instances.editor1.fire( 'lockSnapshot', { dontUpdate: true } );
CKEDITOR.instances.editor1.fire( 'lockSnapshot', { dontUpdate: true } );
  1. That should result with UndoManager lock counter being increased to 2, confirm that by evaluating:
CKEDITOR.instances.editor1.undoManager.locked.level
  1. Type anything in the editable.

Expected result:
No snapshot should be created, undo button should be off/unavailable.

Current result:
Undo button is enabled.

Additional info:

  1. Good news is that it seems not to be recent regression, as I've checked 4.3.0 and the same error occurs there.
  2. Commands do cares about UndoManager being locked, because if you'll perform bold or any other command it will not record snapshot.
  3. Snapshots are not really recorded, you can check that by evaluating CKEDITOR.instances.editor1.undoManager.snapshots.length

Change History (3)

comment:1 Changed 9 years ago by Marek Lewandowski

Giving it a second look it looks like in fact snapshot count is not growing, to confirm that you may evaluate:

CKEDITOR.instances.editor1.undoManager.snapshots.length

But only UI is telling that there are snapshot made / available, when there're not.

comment:2 Changed 9 years ago by Marek Lewandowski

Description: modified (diff)
Summary: Keyboard triggered snapshot doesn't respect undo lockKeypress show that undo is available despite real undo count

comment:3 Changed 9 years ago by Jakub Ś

Status: newconfirmed

I'm not sure which version should I set here. Issue can be reproduced from CKEditor 4.0 beta but CKEDITOR.instances.editor1.undoManager is available from 4.3.

Issue is however confirmed.

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