iOS Question Cancel the auto hiding of the keyboard of webview when keys in textfield

jjung

Member
Licensed User
Hi B4i Support,
I use the webview for load url of special webpage as attach picture.It is auto hide keyboard when I key in textfield. I need to cancel it. Do you help the solution for this case? Please advise. I check in Safari about this webpage and it don't auto hide the keyboard when key in textfield.

Code:
Sub aa_click
webview1.Initialize("webview1")
webview1.ScaleToFit = True
webview1.RequestFocus
webview1.LoadUrl(http://config)
End Sub

I attach the picture when open by Safari and open by Webview
- Open by Safari the keyboard don't auto hide when key in textfield.
- Open by Webview the keyboard will auto hide when key in textfield.
 

Attachments

  • Open by Safari.PNG
    Open by Safari.PNG
    119.1 KB · Views: 355
  • Open by Webview.PNG
    Open by Webview.PNG
    95.6 KB · Views: 383

jjung

Member
Licensed User
Hi
The webpage open by wifi module of product of microchip and I attach the xml code of webpage http://config as attach file. Thank you.
 

Attachments

  • xml code.pdf
    125.2 KB · Views: 318
Upvote 0

jjung

Member
Licensed User
Hi
I need add more detail about auto hiding keyboard. When I click the textfield in the webview the keyboard is opened as normal and then about 1 to 2 sec the keyboard will auto hiding and I don't finish for filling in the textfield. The keyboard don't lock when fill in textfield.I will click textfield and will open keyboard several time. I can key 1-3 word in the textfield per 1 popup of keyboard. Some time can key only 1 word.
 
Upvote 0

jjung

Member
Licensed User
Hi Erel,
I checked in the html code and I found the tabindex was set about 2 or 3 time follow attach picture. I not sure, this is root cause or not?
Do you have the way for cancel the tabindex or change it to more time? I saw in the forums about code of JavaScript as below? This code can implement for fixing this issue or not? Please suggress. Thank you so much.

Dim no AsNativeObject = WebView1
Log(no.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("The code???"))
 

Attachments

  • Textfield Access Point SSID.png
    Textfield Access Point SSID.png
    25.3 KB · Views: 349
  • Textfield Passphrase.png
    Textfield Passphrase.png
    35.4 KB · Views: 295
Upvote 0

jjung

Member
Licensed User
Hi Erel,
Can you help check my code is correctly? I try use java by doing 2 method. The first method don't show anything and problem still find. The second method show error as attach picture.

First method:
Sub button_Click
Dim NativeMe As NativeObject = webview2
NativeMe.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("document.getElementById('net_ap_ssid').tabIndex = -1;"))
NativeMe.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("document.getElementById('net_ap_sec').tabIndex = -1;"))
End Sub

Second method:
Sub button_Click
Dim NativeMe As NativeObject = webview2
NativeMe.RunMethod("Cleartab", Null)
End Sub

#If OBJC
-(void) Cleartab
{
document.getElementById("net_ssid").tabIndex = -1;
document.getElementById("net_sec").tabIndex = -1;
}
#End if
 

Attachments

  • Error.png
    Error.png
    39 KB · Views: 293
Upvote 0
Top