Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android webview bug with maxlength

I have an app using a webview running on Android 2.3. (I only need to target 2.3, its for a specific device). My HTML form has the following textbox in it:

<input type="text" maxlength="8" id="blah" name="blah" />

The webview restricts the length to 8, but when the user goes past that the backspace button basically stops functioning, so they can't go back and change what they've typed in. I tried this on my nexus 7 (2013) running the latest version of KitKat and it just completely ignores maxlength altogether. Am I missing something or is there something special you need to do to set the maxlength of a text field in Android?

like image 741
Ben Avatar asked Aug 26 '26 23:08

Ben


1 Answers

I dont know did you find and try, but when i got the same issue last year i got rid of issue via following:

As you can see in this Project Issue Link this is a common bug and a javascript as recommended on comment can provide a solution for now.

like image 184
DortGen Avatar answered Aug 28 '26 12:08

DortGen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!