   _unregister: ->
     @_canvasElementToFocusOnBlur?.focusCanvas()
     super
+
+  delayedCheckIfValueChanged: ->
+    timeout 0, => @checkIfValueChanged()
 
   checkIfValueChanged: ->
     if @lastValue != @value

    selectionEnd: (v)-> @domElement.selectionEnd = v

  insertAtCursor: (insertValue) ->
    log insertAtCursor: {insertValue}
    # //IE support
    # if (document.selection) {
    #     @domElement.focus();
    #     sel = document.selection.createRange();
    #     sel.text = insertValue;
    # }
    # //MOZILLA and others
    if @domElement.selectionStart || @domElement.selectionStart == '0'
      {value, selectionStart, selectionEnd} = @domElement
      log insertAtCursor: {value, selectionStart, selectionEnd,insertValue}

        padding:          "0"
        textAlign:        options.align || "left"
        verticalAlign:    "bottom"
        overflow:         "hidden"
      on:
        cut:      (keyboardEvent) => @delayedCheckIfValueChanged()
        paste:    (keyboardEvent) => @delayedCheckIfValueChanged()
        drop:     (keyboardEvent) => @delayedCheckIfValueChanged()
        keydown:  (keyboardEvent) => @delayedCheckIfValueChanged();@getCanvasElement()?.keyDownEvent keyboardEvent
        keyup:    (keyboardEvent) => @getCanvasElement()?.keyUpEvent keyboardEvent
        change:   (event) => @checkIfValueChanged()
        input:    (event) => @checkIfValueChanged()
