There seems to be a bug in the TextArea control, where
backspacing a line break doesn't trigger a change event. I can work
around that by detecting the backspace keypress directly and firing
my own event, but then when I check the textHeight of the textArea,
it gives me the height as if the line were still there.
The next time the change event fires (ie the user presses
another key), the control sets the textHeight to the correct value.
I've tried using revalidating the textArea on the backspace key
press, but it doesn't seem to make any difference. I've tested on
both a Mac and a PC.
Is this a know bug or am I just missing something here? Does
anyone have a good workaround?
I was having the same problem while checking for text
overflow in the text area. I was generating a custom event for text
overflow in text area by comparing textheight and control height.
A good workaround i think is to use "callLater()" method.
You need to do the following:
- Put all your code related to height processing in a
separate method. for eg HeightProcessing(arguments_if_any)
- Capture the change event of text area
- Inside change event handler, call the method