From 54346b0ca70120d8c5ce7d41676c326920e78f88 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Fri, 21 Feb 2025 12:13:41 -0800 Subject: [PATCH] fix broken QF cancellation from editor instance (#5054) Define missing cancel method on io object passed from the editor instance to quickFormat dialog. Without this Escape keypresses throws an error because io.cancel is undefined. Followup to #4859 --- chrome/content/zotero/xpcom/editorInstance.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index a3a2d38ccf..d8284f0845 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -1149,6 +1149,14 @@ class EditorInstance { } }, + /** + * Cancel changes to the citation + */ + cancel: function () { + this.citation.citationItems = []; + return this.accept(); + }, + /** * Get a list of items used in the current document * @return {Promise} A promise resolved by the items