-
Notifications
You must be signed in to change notification settings - Fork 496
Flexbox and Textarea #85
Comments
Hmmm, my hesitation with adding |
Hi Phillip, thanks for addressing this. I'm very happy to accept that My understanding is that it does not. I don't even see anything in the spec that looks like it could reasonably be interpreted in this way. But it's possible I've missed something? Would love pointers in that case. Happy to accept an enlightened understanding of the spec! |
I'm not sure either. The best place to get an enlightened understanding of the spec is to email the www-style list, and ask the spec authors themselves. |
I'm unclear as well but my take isn't that the spec does say The <button> reference says:
I'm not sure if it is "valid" for buttons to contain things like These fieldset docs show examples of fieldset being used with children like |
Sorry for the delay following up; I'll subscribe to the www-style list and confirm it, as you suggest. For the record, I think that the most relevant bit of the spec is Section 4, where it says:
I interpret that as meaning that textual content should be treated in essentially the same way as child elements. But I'll see if I can get the spec authors to confirm. |
Just to close the loop on this. I got a couple of replies on www-style, and the view seems to be that the specs here are a bit messed up, so there is no right answer. Basically, the html5 spec says that textarea is a non-replaced element which therefore should, by implication, honour the flexbox layout model. However browsers have in practice never done this, and there are good reasons for thinking this won't change. So there is a case for saying that the spec is just wrong. The discussion can be seen in the archives here: https://lists.w3.org/Archives/Public/www-style/2015Oct/0118.html So should this be documented as a flexbug? In my opinion, the ambiguity has evidently caused confusion even for the spec authors, so it's worth a a few clarifying words, stating that it's debatable whether it should work, but that it definitely doesn't right now. (And perhaps noting that most other HTML form controls appear to be in the same boat). |
Styling within form controls is generally undefined territory. There are both historical and technical reasons for this. Since the issue seems to be about wanting alignment and not really about wanting flex layout, I suspect the CSS Box Alignment spec, once implemented, will be usable here. Or at least, you can make a stronger case that alignment should be honored, even if flex layout isn't triggered. |
Just noticed that I can't seem to get display: flex to work on textarea elements in Chrome, Firefox, or Safari (this is on Yosemite).
For instance, this very simple example:
...renders with foo aligned to the top of the 150px tall container in all 3 browsers. But if I change the container element from a textarea to a div then it works as expected.
My suspicion is that this is just another example of Flexbug 9 ("Some HTML elements can't be flex containers"). In which case I thought it would be worth getting textarea formally added to the list of elements known to suffer from this problem.
However if there's some other explanation for this (eg, perhaps textarea is deliberately excluded from flexbox layout? I don't see anything like that in the spec, but maybe I've missed it...) then I'd certainly be keen to understand the underlying reason.
The text was updated successfully, but these errors were encountered: