From 1d540aa74cdac44124676fe046e6d8ca4e4cf6a2 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 21 Nov 2022 09:14:27 -0700 Subject: [PATCH] Fix additional options to a static list were not properly added if they were in correct format with value & label --- api/js/etemplate/Et2Select/FindSelectOptions.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/Et2Select/FindSelectOptions.ts b/api/js/etemplate/Et2Select/FindSelectOptions.ts index d7d7aab59d..660342d41d 100644 --- a/api/js/etemplate/Et2Select/FindSelectOptions.ts +++ b/api/js/etemplate/Et2Select/FindSelectOptions.ts @@ -173,10 +173,13 @@ export function find_select_options(widget, attr_options?, options : SelectOptio } if(!added) { - options.splice(parseInt(i), 0, typeof value == "object" ? value : { - value: value, - label: content_options[i] - }); + let insert = typeof content_options[i] == "object" && content_options[i].value === value && content_options[i].label ? + content_options[i] : + { + value: value, + label: content_options[i] + }; + options.splice(parseInt(i), 0, insert); } } content_options = options;