HH.textarea usage question

I’m a novice (past beginner stage, I hope) and have a question about HH.textarea. The definition in Halogen.HTML.Elements is:

textarea :: forall w i. Leaf I.HTMLtextarea w i

But shouldn’t it be:

textarea :: forall w i. Node I.HTMLtextarea w i

A Node vs a Leaf, because the HTML is

<textarea [properties]>... some text ...</textarea>

Assuming I got that right, I think the “value” property should be removed from I.HTMLtextarea. I can’t find that property listed in the HTML documentation.

I imagine that normally textArea would be Node and not Leaf. However, that would likely enable invalid HTML. What happens when you put a div as its children?

Looking at HTMLtextarea, I think you value was a workaround to the above problem.

1 Like

value is part of the real API for the element: https://html.spec.whatwg.org/multipage/form-elements.html#htmltextareaelement

I guess technically it should be a special node type that only allows text content, but I think controlling it with value is more natural so it matches the other input types. Well, aside from <select> I suppose.