diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index 18552fc1a..b0d7385cb 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -138,6 +138,7 @@ SelectWidget.prototype.execute = function() { this.selectClass = this.getAttribute("class"); this.selectDefault = this.getAttribute("default"); this.selectMultiple = this.getAttribute("multiple", false); + this.selectSize = this.getAttribute("size"); // Make the child widgets var selectNode = { type: "element", @@ -150,6 +151,9 @@ SelectWidget.prototype.execute = function() { if(this.selectMultiple) { $tw.utils.addAttributeToParseTreeNode(selectNode,"multiple","multiple"); } + if(this.selectSize) { + $tw.utils.addAttributeToParseTreeNode(selectNode,"size",this.selectSize); + } this.makeChildWidgets([selectNode]); }; diff --git a/editions/tw5.com/tiddlers/widgets/SelectWidget.tid b/editions/tw5.com/tiddlers/widgets/SelectWidget.tid index 8eab689bd..f8db9617f 100644 --- a/editions/tw5.com/tiddlers/widgets/SelectWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/SelectWidget.tid @@ -10,6 +10,8 @@ type: text/vnd.tiddlywiki The select widget displays a popup menu based on a [[HTML select element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select]]. The popup (or dropdown) contains a list of items defined by `` elements. Every time the user selects a new value in the menu, the selected value is written to the text of a specified tiddler field or index. If the tiddler value changes the menu is automatically updated to reflect the new value. +In multiple selection mode, the list of selected values is bound to the specified tiddler field or index. Browsers generally use the ctrl or cmd keys for multiple selection. + For example, this select widget displays a list of the tags in this wiki: <$macrocall $name="wikitext-example-without-html" src="<$select tiddler=<> default='HelloThere'> @@ -34,7 +36,8 @@ The content of the `<$select>` widget should be one or more HTML `