1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 03:27:18 +00:00

Fix: resolved issues with select widget after refactoring (#7905)

This commit is contained in:
Saq Imtiaz 2023-12-21 12:50:33 +01:00 committed by GitHub
parent 3d712127ad
commit 46a22ef585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
//Create element //Create element
var domNode = this.document.createElement("select"); var domNode = this.document.createElement("select");
if(this.selectClass) { if(this.selectClass) {
domNode.classname = this.selectClass; domNode.className = this.selectClass;
} }
// Assign data- attributes // Assign data- attributes
this.assignAttributes(domNode,{ this.assignAttributes(domNode,{
@ -62,8 +62,8 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
if(this.selectTooltip) { if(this.selectTooltip) {
domNode.setAttribute("title",this.selectTooltip); domNode.setAttribute("title",this.selectTooltip);
} }
this.renderChildren(domNode,nextSibling);
this.parentDomNode.insertBefore(domNode,nextSibling); this.parentDomNode.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null);
this.domNodes.push(domNode); this.domNodes.push(domNode);
this.setSelectValue(); this.setSelectValue();
if(this.selectFocus == "yes") { if(this.selectFocus == "yes") {

View File

@ -6,7 +6,7 @@ tags: [[$:/tags/wiki-test-spec]]
title: Output title: Output
\whitespace trim \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">
<option disabled>Choose a new text</option> <option disabled>Choose a new text</option>
<option>A Tale of Two Cities</option> <option>A Tale of Two Cities</option>
<option>A New Kind of Science</option> <option>A New Kind of Science</option>
@ -24,4 +24,4 @@ Title1
+ +
title: ExpectedResult title: ExpectedResult
<p><select data-title="Title2" value="Choose a new text" style="color:red;"><option disabled="true">Choose a new text</option><option>A Tale of Two Cities</option><option>A New Kind of Science</option><option>The Dice Man</option></select></p> <p><select class="myclass" data-title="Title2" value="Choose a new text" style="color:red;"><option disabled="true">Choose a new text</option><option>A Tale of Two Cities</option><option>A New Kind of Science</option><option>The Dice Man</option></select></p>