bgrins / ExpandingTextareas

jQuery plugin for elegant expanding textareas
http://bgrins.github.com/ExpandingTextareas/
MIT License
261 stars 73 forks source link

IE9 and backspacing #12

Closed Aaron-Work closed 12 years ago

Aaron-Work commented 12 years ago

Hello, love this plugin. I have one issue and that's with people with IE9. The textarea expands nicely but when you backspace to remove characters or highlight and delete them the textarea does not contract until the user begins typing again.

bgrins commented 12 years ago

Hmm this is weird. I wonder if the propertychange event is not firing when they press backspace. We could capture the backspace keyup or keypress event instead if we need to do this? I'll need to wait until I have access to IE9 to test this.

To test this, you could change this line: textarea.bind("input.expanding propertychange.expanding", resize); to
textarea.bind("input.expanding propertychange.expanding keyup.expanding", resize);

I'll check this when I get a chance if you can't.

bgrins commented 12 years ago

Also, can you tell me if you have the same issue with the demo on this page?

http://www.alistapart.com/articles/expanding-text-areas-made-elegant/

Aaron-Work commented 12 years ago

Your suggestion worked. I changed this line ... textarea.bind("input.expanding propertychange.expanding", resize);

To this and it seem to fix the problem... textarea.bind("input.expanding propertychange.expanding keyup.expanding", resize);

Thanks!

bgrins commented 12 years ago

Nice, good idea! I'll add that in, as I think it is a nice cross browser fix that doesn't add too much overhead