Skip to content

Commit 1080032

Browse files
authored
Add Note About Field Sizing (#90)
Per @Paul-Hebert's suggestion, this adds a note to the readme that there's a CSS-only alternative, albeit with limited browser support. Fixes #89
1 parent 4cb55e2 commit 1080032

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@ If multiple `textarea` elements are wrapped in an `elastic-textarea` they will a
6767
</label>
6868
</elastic-textarea>
6969
```
70+
71+
## CSS-Only Alternative
72+
73+
You may consider using `field-sizing: content` as a CSS-only alternate solution. [MDN says](https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing) "`field-sizing: content` overrides the default preferred sizing of form elements. This setting provides an easy way to configure text inputs to shrinkwrap their content and grow as more text is entered." As of May 2025, this is [only supported in Chromium browsers](https://caniuse.com/mdn-css_properties_field-sizing_content), but it's worth considering as a progressive enhancement if you don't need full cross-browser support.

0 commit comments

Comments
 (0)