TextArea.setSizeFull() in FormLayout


I can’t get setSizeFull() of a TextArea to work in a Form. The width works, but the height is only 8 lines

What am I missing?


TextArea uses an HTML TextArea which does not support height in percentages and because of that setSizeFull() will not work either. The closest you will get is giving the height in pixels, so setHeight(“100px”) would work where as setHeight(“100%”) will not.

Thanks for the reply. What alternatives do I have to implement a full-page rich-text editor?

It does not have to support height in percentage. I think the height is always computed by Javascript at runtime for all the 100% components and set to a computed pixel value.

My problem disappears when I replace the FormLayout with a VerticalLayout then then do a verticallayout.setExpandRatio(richTextArea, 1.0f);

Now I still have two questions:
a) Why does it not work with a FormLayout?
b) Where to put the call to setExpandRatio? Right now I call it on a button click? It should be called after all fields of the form are created

You are correct a full-size TextArea should fork inside a FormLayout. If the “Analyze Layouts” feature in the debug window doesn’t show any sizing errors, I would say this is a bug in FormLayout or/and TextArea. In that case, you could create a simple test application that reproduces the problem and create an