From a8d199967ee9f0ea58130a88eae5b3790e52eda5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 1 Apr 2018 15:34:44 -0400 Subject: [PATCH] Fix crash if item field invalid for new type is open on type change https://forums.zotero.org/discussion/71200/bug-when-changing-item-type-report-id-607330517 --- chrome/content/zotero/bindings/itembox.xml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index ed16f2122..260a03225 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -1087,12 +1087,17 @@ - - this.item.saveTx()); + await this.blurOpenField(); + await this.item.saveTx(); } else { this.refresh(); } if (this.eventHandlers['itemtypechange'] && this.eventHandlers['itemtypechange'].length) { - var self = this; - this.eventHandlers['itemtypechange'].forEach(function (f) f.bind(self)()); + this.eventHandlers['itemtypechange'].forEach(f => f.bind(this)()); } return true; @@ -1169,8 +1174,8 @@ } return false; - ]]> - + }.bind(this))(); + ]]>