From 46a22ef585aaa84bd8dd97310f55db8561df6036 Mon Sep 17 00:00:00 2001 From: Saq Imtiaz Date: Thu, 21 Dec 2023 12:50:33 +0100 Subject: [PATCH] Fix: resolved issues with select widget after refactoring (#7905) --- core/modules/widgets/select.js | 4 ++-- .../widgets/DataAttributes/SelectWidget-DataAttributes.tid | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index f1ea3b331..2940e3be0 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -43,7 +43,7 @@ SelectWidget.prototype.render = function(parent,nextSibling) { //Create element var domNode = this.document.createElement("select"); if(this.selectClass) { - domNode.classname = this.selectClass; + domNode.className = this.selectClass; } // Assign data- attributes this.assignAttributes(domNode,{ @@ -62,8 +62,8 @@ SelectWidget.prototype.render = function(parent,nextSibling) { if(this.selectTooltip) { domNode.setAttribute("title",this.selectTooltip); } - this.renderChildren(domNode,nextSibling); this.parentDomNode.insertBefore(domNode,nextSibling); + this.renderChildren(domNode,null); this.domNodes.push(domNode); this.setSelectValue(); if(this.selectFocus == "yes") { diff --git a/editions/test/tiddlers/tests/data/widgets/DataAttributes/SelectWidget-DataAttributes.tid b/editions/test/tiddlers/tests/data/widgets/DataAttributes/SelectWidget-DataAttributes.tid index de2c9995e..e2006312b 100644 --- a/editions/test/tiddlers/tests/data/widgets/DataAttributes/SelectWidget-DataAttributes.tid +++ b/editions/test/tiddlers/tests/data/widgets/DataAttributes/SelectWidget-DataAttributes.tid @@ -6,7 +6,7 @@ tags: [[$:/tags/wiki-test-spec]] title: Output \whitespace trim -<$select tiddler='New Tiddler' field='text' default='Choose a new text' data-title={{Temp}} style.color={{{ [[Temp]get[color]] }}} onclick="clicked"> +<$select tiddler='New Tiddler' class="myclass" field='text' default='Choose a new text' data-title={{Temp}} style.color={{{ [[Temp]get[color]] }}} onclick="clicked"> @@ -24,4 +24,4 @@ Title1 + title: ExpectedResult -

\ No newline at end of file +

\ No newline at end of file