Search code examples
androidhtmlwebviewandroid-4.0-ice-cream-sandwichright-to-left

Wrong focus area of form elements in android 4 (ICS) WebView


I have a form in a Right To Left html page and I have a WebView that shows it. Html input fields of my page can't get focus when I tap exactly on them but when I try tapping somewhere beside of correct area, it becomes focused. My issue occurs just when the phone is in portrait mode, while I don't face it in landscape mode.

Here are screenshots of aforementioned issue:
portrait mode
landscape mode
Any help will be appreciated.


Solution

  • The problem caused by adding dir attribute with rtl value to html or body tag.
    Your html or body should not have this:

    dir="rtl"