Flex 4.6 hide / undo softkeyboard

I am having problems with the behavior of the on-screen keyboard in flex 4.6 and air 3.1

I have a list with a search bar at the top. When the user selects the TextInput component, a tooltip appears. Now that the user has finished typing and presses the return key (or done / search / ...), I want the on-screen bar to disappear.

What I have tried so far:

  • I set the returnKeyLabel property to "done" and the button shows accordingly. However, it rejects the keyboard only on Android; on iOS, the keyboard just remains.

  • Then I tried not to set returnKeyLabel and manually grab the return key and set the focus to another element that does not require softkeyboard, but that also did not work.

  • I also tried sending my own "fake" click events when I pressed the "Return" key, but that also didn't work.

As part of a search for this issue, I found this Dismiss SoftKeyboard in Flex Mobile , but that didn't work either. Or at least not in flex 4.6

Now does anyone know of a good way to hide the on-screen keyboard or make returnKeyLabel an "done" job in iOS that will work with flex 4.6 / air 3.1?

+6
source share
2 answers

Have you tried something like this?

<s:TextInput prompt="First Name" returnKeyLabel="done" enter="handlerFunction()"/> private function handlerFunction():void{ stage.focus = null } 
+9
source

For flexible mobile apps for Android, I emulated the intuitive ios method of clicking on the background to remove the soft keyboard as follows:

 import spark.components.supportClasses.* protected function application1_clickHandler(event:MouseEvent):void { if(event.target is StyleableTextField || event.target is StyleableStageText){ // ignore because came from a textInput }else{ stage.focus = null // to remove the softkeyboard } } 
+3
source

Source: https://habr.com/ru/post/903843/


All Articles