0

what would be the best way to auto-expand an input field based on user input?

I have an issue below where if there is more than 2 numbers the quantity input gets cut off, and there can be up to say 7 numbers... so I would like it to auto-expand.

If there's a css only solution that would be fabulous. Otherwise that's ok :-)

See below where the quantity is 166578 it doesn't show the full amount:

enter image description here

Thanks!

Kara
  • 55
  • 2
  • 8
  • Post your code, looks like you're limiting it with something. A `select` box will do that by default. https://codepen.io/mcoker/pen/OgeJEZ – Michael Coker Jul 18 '17 at 21:36
  • You probably need to write some JS, look here for example https://stackoverflow.com/questions/8100770/auto-scaling-inputtype-text-to-width-of-value – Telman Jul 18 '17 at 22:52

1 Answers1

0

I think you could set the contenteditable attribute to true and set a min-width and max width in the CSS.

A. Sig
  • 3
  • 3