Coda, 
Sorry, I am with you now. I didn't realize you meant "break the rules" of 
the HTML spec. I didn't think of that, but I agree, re-using an ID is not 
valid HTML. 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. A bigger issue would be the mixed browser support 
for the datalist element, and for these reasons I too am skeptical. I guess 
I would compare this to the "type" attribute. Browser support varies and 
not every type works perfectly, but TiddlyWiki includes it as a parameter 
in the EditText Widget, I suppose to support those edge cases where it 
works. I agree a plugin/js library would provide a more robust solution, 
but I am still on the fence as to whether adding this param makes sense. 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.


On Wednesday, September 18, 2019 at 9:29:31 PM UTC-5, coda coder wrote:
>
>
>
> On Wednesday, September 18, 2019 at 4:58:27 PM UTC-5, Alan Aldrich wrote:
>>
>> 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>. 
>>
>
> Yep, got that, all understood.  But I think you're missing my point. Let 
> me try again...
>
> When you create Tiddler A with <$edit-text id="whatever" ...> and you 
> subsequently RE-USE that content via transclusion in Tiddler B {{Tiddler 
> A}} then you will have broken the rules -- there will be TWO elements with 
> id="whatever" in the document.
>
> *The id attribute MUST be unique across the document* (not including any 
> sub docs, like iframe documents).
>
> I suspect Jeremy doesn't use ids for this very reason.
>
> Unless you're happy creating tiddlers that cannot be used in the normal 
> way, sorry, but this is very likely a non-starter.
>
> The spec:  *When specified on HTML elements 
> <https://html.spec.whatwg.org/multipage/infrastructure.html#html-elements>, 
> the id <https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute> 
> attribute value must be unique amongst all the IDs 
> <https://dom.spec.whatwg.org/#concept-id> in the element's tree 
> <https://dom.spec.whatwg.org/#concept-tree> and must contain at least one 
> character. The value must not contain any ASCII whitespace 
> <https://infra.spec.whatwg.org/#ascii-whitespace>. *
> https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute
>
> MDN: *The id global attribute 
> <https://developer.mozilla.org/en-US/docs/Glossary/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/id
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/8deea1f9-6e00-4abb-a995-ac1282878cb8%40googlegroups.com.

Reply via email to