File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,13 @@ function Expanding (textarea) {
193193 wrap ( textarea , this . element )
194194 this . element . appendChild ( this . textareaClone . element )
195195
196- this . textarea . on ( inputEvent , this . update . bind ( this ) )
196+ var inputHandler = this . update . bind ( this )
197+ this . textarea . on ( inputEvent , inputHandler )
198+ if ( inputEvent !== 'input' ) {
199+ this . textarea . on ( 'cut' , inputHandler )
200+ this . textarea . on ( 'paste' , inputHandler )
201+ }
202+
197203 this . update ( )
198204}
199205
@@ -272,6 +278,9 @@ function setStyles () {
272278
273279 if ( instance ) {
274280 switch ( option ) {
281+ case 'update' :
282+ instance . update ( )
283+ return
275284 case 'destroy' :
276285 $this . removeData ( 'expanding' )
277286 instance . destroy ( )
Original file line number Diff line number Diff line change @@ -194,7 +194,10 @@ function Expanding (textarea) {
194194
195195 var inputHandler = this . update . bind ( this )
196196 this . textarea . on ( inputEvent , inputHandler )
197- this . textarea . on ( 'change' , inputHandler )
197+ if ( inputEvent !== 'input' ) {
198+ this . textarea . on ( 'cut' , inputHandler )
199+ this . textarea . on ( 'paste' , inputHandler )
200+ }
198201
199202 this . update ( )
200203}
You can’t perform that action at this time.
0 commit comments