RichTextArea - getText().length() for no-text mode returns different values

242 views Asked by At

After cut event occurs, I tried to get the RichTextArea inner text length with code like a

int l=getRichTextArea().getText().length();

... but

  • in FF it returns 0
  • in Chrome it returns 1

I couldn't have opportunity to test more internet browsers... So my question is...

Why does it happening? And is there a way to make it return correct value as 0 if richtextarea contains no text?

P.S. GWT 2.3

Thanks

1

There are 1 answers

2
yair On BEST ANSWER

If it's some blank string (like space char) you can use

getRichTextArea().getText().trim().length()