From e1885983d5e3997a03f40082bd53bc3a2205da77 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 28 Jul 2022 09:56:59 -0600 Subject: [PATCH] Hopefully fix missing non-reflected attributes in nm rows without too much of a speed penalty --- .../et2_extension_nextmatch_rowProvider.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts b/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts index 29062f8f82..3cca6f0228 100644 --- a/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts +++ b/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts @@ -266,18 +266,18 @@ export class et2_nextmatch_rowProvider */ _cloneWebComponent(entry, row, data) { - /* - // N.B. cloneNode widget is missing its unreflected properties and we need to use widget.clone() - // instead to get them. This slows things down and is to be avoided if we can. - let c = widget.clone(); - let partial = entry.nodeFuncs[0](row); - partial.parentNode.insertBefore(c, partial); - partial.parentNode.removeChild(partial); - widget = c; - */ - - // Use the clone, not the original + // Widget was already cloned from original row, just get it let widget = entry.nodeFuncs[0](row); + // Original widget + let original = entry.nodeFuncs[0](this._dataRow); + + // N.B. cloneNode widget is missing its unreflected properties and we need to get them from original + let widget_class = window.customElements.get(widget.localName); + let properties = widget_class ? widget_class.properties : []; + for(let key in properties) + { + widget[key] = original[key]; + } if(!widget || widget.localName !== entry.widget.localName) {