By default, and
or any other element that is block-level, it would also expand vertically as needed.
But are non-input elements accessible?
I’m not entirely sure. Notice I put role=textbox on the element. That’s just a best-guess based on some docs.
Even if that’s helpful…
What about the fact that forms can be submitted with the Enter key? What about the idea that form data is often serialized and sent along, while the code that’s doing it probably isn’t looking for a span?Does it actually read the same as an input in a screen reader?What other things¹ do inputs naturally do that I’m not thinking of?
As attracted as I am to the idea that we can get auto-resizing for free from the browser by using non-input elements, I’m also a little worried about (my) unknown usability and accessibility risk.
Resizing actual input elements
So let’s say we stick with and
But are non-input elements accessible?
I’m not entirely sure. Notice I put role=textbox on the element. That’s just a best-guess based on some docs.
Even if that’s helpful…
What about the fact that forms can be submitted with the Enter key? What about the idea that form data is often serialized and sent along, while the code that’s doing it probably isn’t looking for a span?Does it actually read the same as an input in a screen reader?What other things¹ do inputs naturally do that I’m not thinking of?
As attracted as I am to the idea that we can get auto-resizing for free from the browser by using non-input elements, I’m also a little worried about (my) unknown usability and accessibility risk.
Resizing actual input elements
So let’s say we stick with and