set input type back to text when bead is removed
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/0d696541 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/0d696541 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/0d696541 Branch: refs/heads/develop Commit: 0d69654163d8fe0ae7d027f027fa06bb7d71f4bd Parents: 385655a Author: Justin Mclean <jmcl...@apache.org> Authored: Mon Jun 5 13:17:04 2017 +1000 Committer: Justin Mclean <jmcl...@apache.org> Committed: Mon Jun 5 13:17:04 2017 +1000 ---------------------------------------------------------------------- .../flex/html/accessories/PasswordInputBead.as | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0d696541/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as index e73822b..4312100 100644 --- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as +++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as @@ -68,17 +68,27 @@ package org.apache.flex.html.accessories */ public function set strand(value:IStrand):void { - _strand = value; - COMPILE::SWF { + _strand = value; IEventDispatcher(value).addEventListener("viewChanged",viewChangeHandler); } COMPILE::JS { - var host:UIBase = value as UIBase; - var e:HTMLInputElement = host.element as HTMLInputElement; - e.type = 'password'; + var host:UIBase; + var e:HTMLInputElement; + + if (value !== null) {; + host = value as UIBase; + e = host.element as HTMLInputElement; + e.type = 'password'; + } + else { + host = _strand as UIBase; + e = host.element as HTMLInputElement; + e.type = 'text'; + } + _strand = value; } }