Skip to content

Commit

Permalink
Revert 3754 modal textarea (#3780)
Browse files Browse the repository at this point in the history
* Revert "Update path.class.js (#3774)"

This reverts commit a7ff845.

* Revert "switch to canvas prebuilt (#3757)"

This reverts commit b979bd5.

* Revert "Fix textarea focus bug when canvas is in an element that stops events from reaching the body (#3754)"

This reverts commit 3f9b69f.
  • Loading branch information
asturur authored Mar 14, 2017
1 parent a7ff845 commit e5b5e92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/mixins/itext_behavior.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@
p.y = maxHeight;
}

// add canvas offset on document
p.x += this.canvas._offset.left;
p.y += this.canvas._offset.top;

return { left: p.x + 'px', top: p.y + 'px', fontSize: charHeight };
},

Expand Down
4 changes: 1 addition & 3 deletions src/mixins/itext_key_behavior.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
var style = this._calcTextareaPosition();
this.hiddenTextarea.style.cssText = 'position: absolute; top: ' + style.top + '; left: ' + style.left + ';'
+ ' opacity: 0; width: 0px; height: 0px; z-index: -999;';
if (this.canvas) {
this.canvas.lowerCanvasEl.parentNode.appendChild(this.hiddenTextarea);
}
fabric.document.body.appendChild(this.hiddenTextarea);

fabric.util.addListener(this.hiddenTextarea, 'keydown', this.onKeyDown.bind(this));
fabric.util.addListener(this.hiddenTextarea, 'keyup', this.onKeyUp.bind(this));
Expand Down

0 comments on commit e5b5e92

Please sign in to comment.