@@ -86,6 +86,7 @@ export const __meta__ = {
8686 label : null ,
8787 resizable : "none" ,
8888 maxLength : null ,
89+ maxRows : null ,
8990 cols : 20 ,
9091 rows : 1 ,
9192 rounded : "medium" ,
@@ -103,27 +104,29 @@ export const __meta__ = {
103104 } ,
104105
105106 _applyCssClasses : function ( action ) {
106- var that = this ,
107- options = that . options ,
108- resize = kendo . cssProperties . getValidClass ( {
109- widget : options . name ,
110- propName : "resize" ,
111- value : options . resize
112- } ) ,
113- overflow = kendo . cssProperties . getValidClass ( {
114- widget : options . name ,
115- propName : "overflow" ,
116- value : options . overflow
117- } ) ,
118- layoutFlow = kendo . cssProperties . getValidClass ( {
119- widget : options . name ,
120- propName : "layoutFlow" ,
121- value : options . layoutFlow
122- } ) ;
107+ let that = this ;
108+ let options = that . options ;
109+ let resize = kendo . cssProperties . getValidClass ( {
110+ widget : options . name ,
111+ propName : "resize" ,
112+ value : options . resize
113+ } ) ;
114+
115+ let overflow = kendo . cssProperties . getValidClass ( {
116+ widget : options . name ,
117+ propName : "overflow" ,
118+ value : options . overflow
119+ } ) ;
120+
121+ let layoutFlow = kendo . cssProperties . getValidClass ( {
122+ widget : options . name ,
123+ propName : "layoutFlow" ,
124+ value : options . layoutFlow
125+ } ) ;
123126
124127 Widget . fn . _applyCssClasses . call ( that ) ;
125128
126- if ( ! resize && options . resize === "none" ) {
129+ if ( ! resize && ( options . resize === "none" || options . resize === "auto" ) ) {
127130 resize = "k-resize-none" ;
128131 }
129132
@@ -245,6 +248,7 @@ export const __meta__ = {
245248
246249 element . on ( "focusin" + NS , that . _focusin . bind ( that ) ) ;
247250 element . on ( "focusout" + NS , that . _focusout . bind ( that ) ) ;
251+ element . on ( "input" + NS , that . _input . bind ( that ) ) ;
248252 } else {
249253 element . attr ( DISABLED , disable )
250254 . attr ( READONLY , readonly )
@@ -314,6 +318,33 @@ export const __meta__ = {
314318 }
315319 } ,
316320
321+ _input : function ( ) {
322+ const that = this ;
323+ const element = that . element ;
324+ const options = that . options ;
325+
326+ if ( options . resize === "auto" && options . maxRows ) {
327+ const computedStyle = getComputedStyle ( element [ 0 ] ) ;
328+ const lineHeight = parseInt ( computedStyle . lineHeight , 10 ) || 16 ;
329+ const paddingTop = parseInt ( computedStyle . paddingTop , 10 ) || 0 ;
330+ const paddingBottom = parseInt ( computedStyle . paddingBottom , 10 ) || 0 ;
331+ const totalPadding = paddingTop + paddingBottom ;
332+ const minHeight = ( options . rows * lineHeight ) + totalPadding ;
333+ const maxHeight = ( options . maxRows * lineHeight ) + totalPadding ;
334+
335+ element . css ( {
336+ height : minHeight + "px"
337+ } ) ;
338+
339+ const scrollHeight = element [ 0 ] . scrollHeight ;
340+
341+ element . css ( {
342+ maxHeight : maxHeight + "px" ,
343+ height : scrollHeight + "px"
344+ } ) ;
345+ }
346+ } ,
347+
317348 _wrapper : function ( ) {
318349 var that = this ;
319350 var element = that . element ;
0 commit comments