     @validationNotifications = {}
     @valid = yes
     @inputCallback = null
+    @previousHeight= null
     @setName options.name
     @setLabel()
     @setCallback()

    @on 'input', (event) => KD.utils.defer => @resize event


  resize: do ->

    previousHeight = null

    (event) ->

      return  unless @_clone

      @_clone.appendTo 'body' unless document.body.contains @_clone[0]
      val = @getElement().value.replace(/\n/g,'\n&nbsp;')
      safeValue = Encoder.XSSEncode val
      @_clone.html safeValue

      height = @_clone.height()

      getValue = (rule) => parseInt @_clone.css(rule), 10

      if @$().css('boxSizing') is 'border-box'
        padding = getValue('paddingTop')     + getValue('paddingBottom')
        border  = getValue('borderTopWidth') + getValue('borderBottomWidth')
        height  = height + border + padding

      newHeight = if @initialHeight then Math.max @initialHeight, height else height

      if previousHeight isnt newHeight
        @setHeight newHeight
        @emit 'InputHeightChanged'

      previousHeight = newHeight


  enableTabKey:-> @inputTabKeyEnabled = yes

    for rule in @ruleChain
      @validationResults[rule] = null


  setValidationResult:(rule, err, showNotification=yes)->

    if err
      @validationResults[rule] = err
      @showValidationError err if @getOptions().validate.notifications and showNotification
