Opened 10 years ago
Last modified 10 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 )
It seems that if I lock the UndoManager for snapshots, keyboard presses will still render undo button to indicate that undo steps are available.
- Open any sample with CKEditor. (i.e. samples/replacebyclass.html)
- Go to JavaScript console, and enter following code:
CKEDITOR.instances.editor1.fire( 'lockSnapshot', { dontUpdate: true } ); CKEDITOR.instances.editor1.fire( 'lockSnapshot', { dontUpdate: true } );
- That should result with UndoManager lock counter being increased to
2
, confirm that by evaluating:
CKEDITOR.instances.editor1.undoManager.locked.level
- 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:
- Good news is that it seems not to be recent regression, as I've checked 4.3.0 and the same error occurs there.
- Commands do cares about UndoManager being locked, because if you'll perform bold or any other command it will not record snapshot.
- Snapshots are not really recorded, you can check that by evaluating
CKEDITOR.instances.editor1.undoManager.snapshots.length
Change History (3)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Summary: | Keyboard triggered snapshot doesn't respect undo lock → Keypress show that undo is available despite real undo count |
comment:3 Changed 10 years ago by
Status: | new → confirmed |
---|
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.
Giving it a second look it looks like in fact snapshot count is not growing, to confirm that you may evaluate:
But only UI is telling that there are snapshot made / available, when there're not.