Is it possible to fit the <input>
HTML component to the size of its "content"? It doesn't respond to width: fit-content
CSS.
Asked
Active
Viewed 31 times
0

croraf
- 4,332
- 2
- 31
- 50
-
[Does this help](https://stackoverflow.com/a/4622119/16234808) – Nov 22 '21 at 20:04
-
1nop, when you type inside an input you actually fill the value attribute ;) take a look at https://stackoverflow.com/questions/64092841/react-how-to-make-an-input-only-as-wide-as-the-amount-of-text-provided/64094013#64094013 or https://stackoverflow.com/questions/69150051/get-input-children-of-grid-to-grow-and-shrink-based-on-content/69154637#69154637 if its also about ellipsis at a certain point – G-Cyrillus Nov 22 '21 at 20:08
-
@G-Cyrillus Thanks yes, that helps. Seems that "input" element does not allow that inherently, which is unfortunate :( – croraf Nov 22 '21 at 20:12