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.
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>.
idattribute 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-attribute
idglobal attribute defines an identifier (ID) which must be unique in the whole document. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
I 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.
Hopefully I am explaining this clearly.
What this means to me is we will likely need a customized solution.