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

> @bfgeek If the main problem is with min-width/height: auto, we can define auto there to resolve to the current width/height calculation. In other words, define the “content size suggestion” for form controls to be the current default size. You'll often want to shut off the automatic minimum to allow it to shrink further, but as @LeaVerou points out, authors need to specify an explicit minimum to get reasonable behavior there anyway. I think this interpretation would give us a pretty reasonable and useful behavior tbh.

There are several interactions which will cause developer confusion here, this I think is the main "breaks existing content one", but I'd still place a non-trivial risk of the "min-content"/etc being used on `<input>`s and friends.

There are many different ways to trigger the current default/legacy magical behaviour - which I suspect will cause developer confusion.

A use-case which I want to ensure we get right is "I want all `<input>`s in the column to be the size of the largest input".
(Lots of `<input>`s in "table-like"[1] things is a super common case in enterprise software unsuprisingly).

 A reasonable solution to this would be:
```
<!DOCTYPE html>
<style>
input { min-width: max-input; width: 100%; box-sizing: border-box; }
</style>
<table border=1>
  <tr><td><input style="min-width: 30px; /* for demonstration pretend max-input = 30px */"></td></tr>
  <tr><td><input style="min-width: 40px; /* for demonstration pretend max-input = 40px */"></td></tr>
</table>
```

Here you'd expect the column to be 40px wide, and all the `<input>`s to match, but it'll be the current "default"/"legacy" size of "magical number", as while calculating the intrinsic sizes the `100%` becomes `auto` (and I think we've established we can't change the default `auto` behaviour by default).

[1] May not be an actual table, but typically one.

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


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

Received on Friday, 5 May 2023 17:21:24 UTC