From ccdcb1bf72d496e71d2f0ce59a5d6e73ab6d8c3f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 8 Jan 2019 04:28:28 -0500 Subject: [PATCH] Fix adding new advanced search row with More field selected Broken in 28aa86eb79f --- chrome/content/zotero/bindings/zoterosearch.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bindings/zoterosearch.xml b/chrome/content/zotero/bindings/zoterosearch.xml index 246601befc..6de05ad71a 100644 --- a/chrome/content/zotero/bindings/zoterosearch.xml +++ b/chrome/content/zotero/bindings/zoterosearch.xml @@ -440,6 +440,10 @@ var operators = condition.operators; conditionsMenu.value = conditionName; + // Store in attribute as well because the value doesn't get set properly when + // the value is from a menuitem in the More menu, and we need this to select + // the previous condition when creating a new row + conditionsMenu.setAttribute('data-value', conditionName); // Parent state isn't set automatically for submenu selections if (!this.isPrimaryCondition(conditionName)) { @@ -814,7 +818,7 @@ if (this.parent){ let ref = this.parent.search.getCondition( this.parent.search.addCondition( - this.id('conditionsmenu').value, + this.id('conditionsmenu').getAttribute('data-value'), this.id('operatorsmenu').value, "" )