Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Fix Textarea autosize calculation in special case #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions framework/source/class/qx/ui/form/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ qx.Class.define("qx.ui.form.TextArea",
this.initWrap();

this.addListener("roll", this._onRoll, this);
this.addListener("resize", this._onResize, this);
},


Expand Down Expand Up @@ -150,6 +151,21 @@ qx.Class.define("qx.ui.form.TextArea",
e.stop();
}
},


/**
* When the element resizes we throw away the clone and trigger autosize again, otherwise the clone would have
* another width and the autosize calculation would be faulty.
*
* @param e {qx.event.type.Data} resize event.
*/
_onResize : function(e) {
if (this.__areaClone) {
this.__areaClone.dispose();
this.__areaClone = null;
this.__autoSize();
}
},

/*
---------------------------------------------------------------------------
Expand Down