Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

richTextArea setReadOnly - not what I was expecting

Yinon Shiryan
5 years ago Jun 20, 2016 6:30pm

Is there a way to disable editing the vaadin richtextarea\textarea but keep the vertical scroller when text longer than the component heigh? 

if you add a text longer than the high of the component it will add the vertical  scroll only if the component it is enabled . 
I would expect to at least show the scroll even if the user can't actually scroll he can figure out that there's more hidden text.

I also tried setReadonly  for the richtextarea  - I didn't expect it to remove the toolbar ... I was actually sure that this it is what I need until I tested it. ironically it thorws exception if you add text from the code so I had to set readonly false before I add text and set readonly true again when I'm done - that would be ok (eventhough it doesn't really make sense) unless it doesnt do what it is expected ... I would again , expect to see the vertical scroller and let the user scroll down and read (read only)....


Henrik Nyman
5 years ago Jul 14, 2016 7:22am

Hi Yinon,

when setting a RichTextArea to read only mode I believe that it is intended that the scrollbar should be visible. It looks like there has been a regression regarding this issue, please see https://dev.vaadin.com/ticket/7036. I will create a new trac ticket regarding this issue.

Fortunately, there is a relatively simple workaround. Just add the following to your theme and the scrollbar should be visible in read only mode.

.v-richtextarea-readonly {
    overflow: auto;

I hope this works for you.

Best regards,


jose luis romero
4 years ago May 12, 2017 6:29pm