Re: [csswg-drafts] [css-ui] ? Allow <textarea> to be sized by contents. (#7542)

This would be an excellent addition!

I think a common scenario for this is chat boxes, as in the Slack screenshot below. Notably, these tend to grow upward – presumably this is best done by placing the dynamically-sized textarea at the bottom of a flexbox. As you write and test the initial browser implementation, it might be worth implementing the chat box scenario to check that we're not running into edge cases that are unexpectedly difficult to implement.

<table><tr><td>
<img width="300" alt="image" src="https://github.com/w3c/csswg-drafts/assets/524783/a6997947-e1d2-47e3-bed4-7f8adeefce6f">
</td></tr></table>

Some interesting edges cases off the top of my head:

* If you come back to a conversation with an unsent draft in the chat box that exceeds the maximum height, WhatsApp's behavior (on iOS) is to pre-scroll the chat box to the bottom:

    <table><tr><td>
    <img width="250" src="https://github.com/w3c/csswg-drafts/assets/524783/e0108292-89a1-401e-a2aa-a6e499d7188f">
    </td></tr></table>

* Programmatic changes to the textarea contents, such as a /slash command expanding into a template, might cause the textarea to resize and possibly reach its maximum height. Here again, there might be interesting interactions between the resizing, the upwards growth, and the textarea scroll.

-- 
GitHub Notification of comment by joliss
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7542#issuecomment-1731061198 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 22 September 2023 08:55:30 UTC