Merge pull request #1961 from asturur/fix-EnterEdit

Add forcedfocus on enterEditing
This commit is contained in:
Juriy Zaytsev 2015-02-05 17:08:16 +01:00
commit 3b19175a70
2 changed files with 1 additions and 10 deletions

View file

@ -325,6 +325,7 @@
this.isEditing = true;
this.initHiddenTextarea();
this.hiddenTextarea.focus();
this._updateTextarea();
this._saveEditingProps();
this._setEditingProps();

View file

@ -15,11 +15,6 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
fabric.util.addListener(this.hiddenTextarea, 'keypress', this.onKeyPress.bind(this));
fabric.util.addListener(this.hiddenTextarea, 'copy', this.copy.bind(this));
fabric.util.addListener(this.hiddenTextarea, 'paste', this.paste.bind(this));
if (!this._clickHandlerInitialized && this.canvas) {
fabric.util.addListener(this.canvas.upperCanvasEl, 'click', this.onClick.bind(this));
this._clickHandlerInitialized = true;
}
},
/**
@ -49,11 +44,6 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
88: 'cut'
},
onClick: function() {
// No need to trigger click event here, focus is enough to have the keyboard appear on Android
this.hiddenTextarea && this.hiddenTextarea.focus();
},
/**
* Handles keyup event
* @param {Event} e Event object