From 010b782a9665aadbde0e93b169f3311b9272bee3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 1 Apr 2021 14:59:18 +0200 Subject: [PATCH] allow t.map render fn to not return a dom node --- src/platform/web/ui/general/TemplateView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/web/ui/general/TemplateView.js b/src/platform/web/ui/general/TemplateView.js index 6b016b9b..e82a492e 100644 --- a/src/platform/web/ui/general/TemplateView.js +++ b/src/platform/web/ui/general/TemplateView.js @@ -322,7 +322,11 @@ class TemplateBuilder { map(mapFn, renderFn) { return this.mapView(mapFn, mappedValue => { return new TemplateView(this._value, (t, vm) => { - return renderFn(mappedValue, t, vm); + const rootNode = renderFn(mappedValue, t, vm); + if (!rootNode) { + return document.createComment("map placeholder"); + } + return rootNode; }); }); }