File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,10 @@ function Expanding (textarea) {
193193 wrap ( textarea , this . element )
194194 this . element . appendChild ( this . textareaClone . element )
195195
196+ var inputHandler = this . update . bind ( this )
196197 this . textarea . on ( inputEvent , this . update . bind ( this ) )
198+ if ( inputEvent !== 'input' ) this . textarea . on ( 'paste' , inputHandler )
199+
197200 this . update ( )
198201}
199202
@@ -272,6 +275,9 @@ function setStyles () {
272275
273276 if ( instance ) {
274277 switch ( option ) {
278+ case 'update' :
279+ instance . update ( )
280+ return
275281 case 'destroy' :
276282 $this . removeData ( 'expanding' )
277283 instance . destroy ( )
Original file line number Diff line number Diff line change @@ -193,8 +193,8 @@ function Expanding (textarea) {
193193 this . element . appendChild ( this . textareaClone . element )
194194
195195 var inputHandler = this . update . bind ( this )
196- this . textarea . on ( inputEvent , inputHandler )
197- this . textarea . on ( 'change ' , inputHandler )
196+ this . textarea . on ( inputEvent , this . update . bind ( this ) )
197+ if ( inputEvent !== 'input' ) this . textarea . on ( 'paste ' , inputHandler )
198198
199199 this . update ( )
200200}
You can’t perform that action at this time.
0 commit comments