Text area with one line

Hello, is it somehow possible to adjust the minimum height of a text area so that it has just one line? I am using the text area as info box (read only) to display some text
image.png

There’s an open issue: [text-area] Min/max rows attributes/properties · Issue #1399 · vaadin/web-components · GitHub

As a workaround, you can try setting rows="1" and min-height: 0 for the internal textarea element.

do you mean the vaadin-input-container component with the internal element?
image.png

no, the textarea element

like this?
image.png

no, there’s an element <textarea> there in your screenshot. Not the <slot>, not the <vaadin-input-container>

aaah okay, now i got it

but how can I access the textarea element from Java in order to add the rows attribute?

In JavaScript:

tex.setAttribute('rows','1');
tex.style.minHeight = 0;

In Java (in a single line):

There are probably other ways of getting the target element, given that it’s in light dom; that one ( getElementsByTagName) relies on it being a textarea specifically

Alright, thank you :slightly_smiling_face: