Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34365

TextInput's displayAsPassword related errors

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Apache Flex 4.12.0, Apache Flex 4.12.1
    • Component/s: Spark: TextInput
    • Environment:

      Description

      Run the following code on an Android mobile project:

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      title="DisplayAsPassword">

      <fx:Script>
      <![CDATA[

      /**

      • Shows or hides the characters in the password field.
        */
        protected function togglePasswordDisplay(event:Event):void { appPassword.displayAsPassword = !event.target.selected; }

      ]]>
      </fx:Script>

      <s:TextInput id="appPassword"
      restrict="-A-Za-z0-9._" displayAsPassword="true"
      top="20" left="20" right="20"/>
      <s:CheckBox id="showPasswordButton"
      change="togglePasswordDisplay(event)"
      top="

      {appPassword.y + appPassword.height + 20}" horizontalCenter="0"/>

      </s:View>

      When the CheckBox's selected property changes, the TextInput's displayAsPassword property won't. If the CheckBox's selected property changes and then the TextInput is focused, then the displayAsPassword property changes.

      The following solves the property update problem but introduces a new one:

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      title="DisplayAsPassword">

      <s:TextInput id="appPassword"
      restrict="-A-Za-z0-9._" displayAsPassword="{!showPasswordButton.selected}"
      top="20" left="0" right="0"/>
      <s:CheckBox id="showPasswordButton"
      selected="false"
      top="{appPassword.y + appPassword.height + 20}

      " horizontalCenter="0"/>

      </s:View>

      When the displayAsPassword property is updated to false and then the TextInput is focused, the text blinking cursor will be positioned where the end of the text would be if the displayAsPassword was true.

      This problem is not present in version 4.6 and 4.11 from the SDK, so the bug must be introduced on 4.12.0.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebastiantoro84 Sebastian Toro
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: