ExpandingTextareas icon indicating copy to clipboard operation
ExpandingTextareas copied to clipboard

Improve update

Open domchristie opened this issue 9 years ago • 3 comments

Removes the unnecessary call to update the clone textarea on change, since it should already have updated on the input event. It also exposes the update method to the jQuery plugin, so that rather than accessing the Expanding instance and calling update:

$('textarea').data('expanding').update()

users can do:

$('textarea').expanding('update')

as is shown in the updated demo.

domchristie avatar Nov 07 '16 17:11 domchristie

I thought there was some case on older browsers not supporting 'input' that change would capture cases where keyup didn't (maybe right click -> paste for instance). However, at this point I think we can assume it's available: http://caniuse.com/#feat=input-event

bgrins avatar Nov 07 '16 18:11 bgrins

Looks fine to me if you are OK with https://github.com/bgrins/ExpandingTextareas/pull/68#issuecomment-258918552

bgrins avatar Nov 07 '16 18:11 bgrins

I thought there was some case on older browsers not supporting 'input' that change would capture cases where keyup didn't (maybe right click -> paste for instance)

Good point: I have added a paste handler for browsers that do not support input.

domchristie avatar Nov 07 '16 19:11 domchristie