I support this request whole heartedly because it is a despratly needed missing feature.
I see the value in the edit text widget but also suggest also improving the existing select widget or even a new widget.
------------
However I would like to add I see a number of gaps like this between what we can do in tiddlywiki and what is available in html5. We could let this evolve and address these gaps as they are raised like this one. However I think there would be value Actualy hunting for these differences and accommodating them in tiddlywiki.
The fact is a lot of html5 features are denighed from us because we can't reference the result. This datalist method is a perfect example. You can code the html and it works except you can't access the result. This is to do with how html references the dom but not the one tiddlywiki core uses.
I believe strongly that a creative guru with tiddlywiki and dom skills could however find a way to let tiddlywiki access the result of a html operation and make it available, if only to the local wiki text. This would open many html5 features up for use in wiki text including your current datalist example. Not withstanding this I think your suggestions or versions there of, should be implemented.
Regards
Tony
var x = document.createElement("DATALIST");
var x = document.getElementById("myDetails");
<select id=sresult>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<datalist id="testlist">
<option value="Chrome"></option>
<option value="Firefox">Default</option>
<option value="Safari"></option>
<option value="Opera"></option>
<option value="Internet Explorer"></option>
<option value="Microsoft Edge"></option>
</datalist>
coda coder,Yes the id attribute is required for the datalist element to work. It must match the list attribute of the input element generated by the EditText Widget. I am requesting we modify the EditText Widget to include a parameter called list to allow the use of <datalist>.
id
attribute
value must be unique amongst all the IDs in the element's
tree and must contain at least one character. The value must not contain any
ASCII whitespace. https://html.spec.whatwg.org/multipage/dom.html#the-id-attributeid
global attribute defines an identifier (ID) which must be unique in the whole document. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/idI don't know if there are exceptions to this rule for elements like datalist, but there should be.
Re-using a datalist when it makes sense to seems efficient to me.
I really think this functionality (using arrow keys and enter key to choose an auto-complete option) should exist as a core feature, not a bolt-on. In any case, I am tired of picking up my mouse when I search for something in TiddlyWiki.
<$edit-text>
widget is ignored. So if it could supply wikitext interpreted as the data list perhaps we just extend the edit-text widget. However people may instinctively look in the select widget for this functionality as well.<$edit-text tiddler="TargetTiddler" tag="input" default="" focusPopup="$:/state/demo" class="tc-popup-handle"/>
<$reveal state="$:/state/demo" type="nomatch" text="" default="">
<div class="tc-block-dropdown">
<$linkcatcher to="TargetTiddler">
<div class="tc-dropdown-item">
[[A value to set]]
[[Another value]]
[[These links could be generated]]
[[by a list widget, too]]
</div>
</$linkcatcher>
</div>
</$reveal>
Hopefully I am explaining this clearly.
What this means to me is we will likely need a customized solution.