From 558bbb985a0331388d16edc924ef2d5c175d35f4 Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 27 Apr 2020 10:07:26 +0200 Subject: [PATCH] root: more strict singleton fix --- src/client/widgets/common/widget.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 0b060835..fc1fff1b 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -183,10 +183,17 @@ class Widget extends EventEmitter { this.createPropsCache() if (this.getProp('id') == 'root' && this.parent !== widgetManager) { + this.props.id = '_root' this.cachedProps.id = '_root' - this.errors.id = 'There can only be one root' } + if (this.getProp('type') == 'root' && this.parent !== widgetManager) { + this.props.type = 'panel' + this.cachedProps.type = 'panel' + } + + + // cache decimals if (this.props.decimals !== undefined) { this.decimals = Math.min(20, Math.max(this.getProp('decimals'), 0))