Skip to main content
Known Participant
June 17, 2014
Question

How do I stop predictive text in username text input field?

  • June 17, 2014
  • 1 reply
  • 1120 views

In Android devices, predictive text is making impossible for users to log on. When predictive text is turned off, the username text input works fine. When predictive text is turned on, the device adds text as you type in the username. Is there anyway to stop this? The only way to stop this right now is to enable the display as password option for the text input. But that is weird, so I would like to know if someone has another suggestion.

This topic has been closed for replies.

1 reply

June 18, 2014

You can use StageText instead of a regular TextField object. I just created a quick text of using StageText and tested it on my Moto X. One of the properties of StageText is "autoCorrect". I use the Google Keyboard and it still gave suggestions for autocorrect but it didnt automatically fix the "broken" words for me. Below is the code I used for a quick test I did on my phone.

import flash.text.StageText;

import flash.geom.Rectangle;

var textfield:StageText = new StageText();

textfield.autoCorrect = false;

textfield.fontSize = 20;

textfield.stage = this.stage;// must set to make visible. Set to "null" to hide

textfield.viewPort = new Rectangle(10, 10, this.stage.stageWidth - 20, this.stage.stageHeight - 20);

But if you absolutely had to use a TextField, I did think of a possibly ugly solution though. Create two textfields and have them be the same width/height and stacked on top of each other. Set the top one to be of type DYNAMIC and have its mouseEnabled set to false. The bottom one should be set to type INPUT, have its alpha set to 0, and add a listener for the Event.CHANGE event. When that event fires, copy the text from the INPUT textfield to the DYNAMIC textfield. The biggest downside to this is that the user can't tap to change the cursor location accurately or see where the cursor is. I tested this and it does work, but is not the ideal solve.

EastManAuthor
Known Participant
July 23, 2014

wadewalker

Thank you for taking the time to provide a suggestion. I apologize for not replying sooner. Fortunately, the new update of Adobe AIR fixed the problem. Thanks again.