diff --git a/CHANGELOG.md b/CHANGELOG.md index ca382d4b97b..6aa285b8ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [4.0.0-beta.6] + +fix(fabric.IText): exitEditing won't error on missing hiddenTextarea. [#6138](https://github.com/fabricjs/fabric.js/pull/6138) + ## [4.0.0-beta.5] fix(fabric.Object): getObjectScaling takes in account rotation of objects inside groups. [#6118](https://github.com/fabricjs/fabric.js/pull/6118) diff --git a/HEADER.js b/HEADER.js index 09f1728cc69..21b754e2dc3 100644 --- a/HEADER.js +++ b/HEADER.js @@ -1,6 +1,6 @@ /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ -var fabric = fabric || { version: '4.0.0-beta.5' }; +var fabric = fabric || { version: '4.0.0-beta.6' }; if (typeof exports !== 'undefined') { exports.fabric = fabric; } diff --git a/package.json b/package.json index 8bdea23fd97..18e81c3da7d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "fabric", "description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.", "homepage": "http://fabricjs.com/", - "version": "4.0.0-beta.5", + "version": "4.0.0-beta.6", "author": "Juriy Zaytsev ", "contributors": [ { diff --git a/src/mixins/itext_behavior.mixin.js b/src/mixins/itext_behavior.mixin.js index fb18856c6b8..bbc46637978 100644 --- a/src/mixins/itext_behavior.mixin.js +++ b/src/mixins/itext_behavior.mixin.js @@ -601,17 +601,17 @@ */ exitEditing: function() { var isTextChanged = (this._textBeforeEdit !== this.text); + var hiddenTextarea = this.hiddenTextarea; this.selected = false; this.isEditing = false; this.selectionEnd = this.selectionStart; - if (this.hiddenTextarea) { - this.hiddenTextarea.blur && this.hiddenTextarea.blur(); - this.canvas && this.hiddenTextarea.parentNode.removeChild(this.hiddenTextarea); - this.hiddenTextarea = null; + if (hiddenTextarea) { + hiddenTextarea.blur && hiddenTextarea.blur(); + hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea); } - + this.hiddenTextarea = null; this.abortCursorAnimation(); this._restoreEditingProps(); this._currentCursorOpacity = 0;