I am making a Japanese typing game for the browser using HTML, CSS and JavaScript. Everything is fine, except when I type hiragana cahrecters into the input field, it suggests different hiragana and kanji. This basically ruins the point of the typing game. The HTML autocomplete = "off" does not work... Any ideas?
2 Answers
autocomplete="one-time-code"
A lot of browsers ignore off, autocomplete="new-password"
works but then the browser might suggest a strong password, "one-time-code" is officially supported.
But really, you can just use any random string for the field and it should work, like
autocomplete="seriously-please-don't-autocomplete"
And if that doesn't work, this hack generally does:
<input readonly onfocus="this.removeAttribute('readonly');">

- 62,300
- 5
- 72
- 93
-
I appreciate you offering an answer. I tried all of that, but it seems like the Japanese autosuggest functionality is operating on a different level than all of these things. There is a way to fix it in OS settings, but that turns off auto suggest for Japanese input across applications which makes it impossible to do work in Japanese. One hint might be the fact that it is not autocomplete, but actually more like autosuggest. Do you have experience typing in Japanese? I think it involves a lot of other things behind the scenes – at_ease_jonathan Sep 23 '21 at 13:28
For Chrome, <input type="search">
might be the behavior you want.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search
type=search
is similar to text, but may be implemented specifically for search fields.
Currently Chrome does not show IME suggestions when type=search
is specified.
It seems that consideration is given so that the search field suggestions and IME suggestions do not overlap.
I don't know that it can be implemented with other input elements
A related specification is inputmode="search".
I tried <input type="text" inputmode="search">
, <textarea inputmode="search">
, but IME suggestions were displayed.

- 1
- 1