This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.
Public Method Question Editor API

undo()

Revert Question Editor state to a previously captured state.

Conditions that may prevent operation to be performed:

  • A previous Undo/Redo operation is still running.
  • There are no previous snapshots to revert to.
  • A snapshot is currently being saved.
  • The page has not yet completely loaded.

To know when the undo operation has completed, listen to the revisionHistoryState:change (refer to event types) and watch for when either canUndo or canRedo is true.

Examples

// event to listen - after modifying any input field
questionEditorApp.on("revisionHistoryState:change", function (data) {
    console.log(data); //{canUndo: true, canRedo: false}
});

questionEditorApp.undo(); //{canUndo: false, canRedo: true}

Arguments

None.

Return value

  • boolean
    If the operation can not be performed, then false is returned
  • null
    If the operation can be performed, then null is returned
Was this article helpful?