make sure we know autosize settings before setting text
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9ab3b569 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9ab3b569 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9ab3b569 Branch: refs/heads/develop Commit: 9ab3b569208393549565dbf352f8f65348b6abcf Parents: 8f3c9a0 Author: Alex Harui <[email protected]> Authored: Thu Apr 27 23:57:19 2017 -0700 Committer: Alex Harui <[email protected]> Committed: Thu Apr 27 23:57:19 2017 -0700 ---------------------------------------------------------------------- .../org/apache/flex/html/beads/TextFieldViewBase.as | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9ab3b569/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as index 75cafb1..8176f53 100644 --- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as +++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as @@ -96,14 +96,16 @@ package org.apache.flex.html.beads IEventDispatcher(_strand).addEventListener("heightChanged", heightChangeHandler); IEventDispatcher(_strand).addEventListener("sizeChanged", sizeChangeHandler); DisplayObjectContainer(value).addChild(_textField); - if (_textModel.text !== null) - text = _textModel.text; - if (_textModel.html !== null) - html = _textModel.html; - + var ilc:ILayoutChild = host as ILayoutChild; autoHeight = ilc.isHeightSizedToContent(); autoWidth = ilc.isWidthSizedToContent(); + + if (_textModel.text !== null) + text = _textModel.text; + if (_textModel.html !== null) + html = _textModel.html; + if (!autoWidth && !isNaN(ilc.explicitWidth)) { widthChangeHandler(null);
