How to disable autocorrect in HTML input on Android?

后端 未结 3 787
灰色年华
灰色年华 2021-02-12 17:50

I can not disable autocorrect of text input in web browser on Android.

I tried this:



        
相关标签:
3条回答
  • 2021-02-12 17:59

    Currently autosuggest="off" does not work. I reported a ticket for it, so you can vote.

    Steps to reproduce the problem:

    1. Open https://output.jsbin.com/qacoforama/3?output in mobile Chrome.

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>Chrome Android autocorrect</title>
      <meta name="viewport" content="width=device-width">
    </head>
    <body>
    
      <h3>Android keyboard shows suggestions on typing</h3>
      <p>when autocorrect="off"</p>
      <p><input type="text" autocorrect="off" autocomplete="off"></p>
      <p>Tested in Chrome 70.0.3538.80</p>
    </body>
    </html>

    1. Try to type something in the input field
    2. You will see keyboard suggestions

    What is the expected behavior? You should not see any suggestions, because "autocorrect" attribute on input field set at "off"

    What went wrong? One picture with suggestions is Chrome, and another one without suggestions is Safari

    Did this work before? Yes It initially started to work in Chrome 38, can't say about other versions and when it became broken

    Does this work in other browsers? No 1) Mobile Safari There is no such problem in mobile Safari. The keyboard does not provide any suggestions when autocorrect="off" 2) Mobile Firefox The same problem as in Chrome: autocorrect="off" does not work, so one can see some suggested words

    Chrome version: 70.0.3538.80 Channel: stable OS Version: 7.0 Flash Version:

    There is an old issue where the same problem was described https://bugs.chromium.org/p/chromium/issues/detail?id=303883.

    As a result the issue was resolved and autocorrect="off" was honored. But at some moment it was broken and still does not work.

    https://bugs.chromium.org/p/chromium/issues/detail?id=901839

    0 讨论(0)
  • 2021-02-12 18:09

    In experiencing the same issue I did some digging and discovered it is indeed a bug in Chrome for Android. It appears to just recently have been fixed and hopefully should be released in an update soon.

    https://code.google.com/p/chromium/issues/detail?id=303883&q=autocorrect&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified

    Also feel free to Star the issue to help boost the ranking...

    0 讨论(0)
  • 2021-02-12 18:11

    Please try this: http://jsfiddle.net/c9HQT/

    Basically you are using Javascript to set the value after every keystroke, hopefully interrupting the auto-complete.

    $('input').on 'keypress', ->
      console.log $(this).val()
      $(this).val $(this).val()
    
    0 讨论(0)
提交回复
热议问题