-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] Is it possible to type both kana and romaji in the same input without having the romaji immediately converted to kana? #100
Comments
Hey there! Handling conversion gets a bit awkward due to a number of edge cases related to cursor positioning, whether the input is coming from an English input or from an IME that is set to Romaji input etc etc. The main issue causing you trouble is that when a new romaji character is entered and the input cursor is not at the beginning, we check backwards for preceding romaji in order to handle situations where the user has moved the cursor (i.e. it's not at the final position, maybe they're trying to correct a typo because they missed a letter) or when the end result is somewhat ambiguous (i.e. when So I believe that because you're rebinding and the cursor is not at the beginning, the result is not what you want: One possible solution is for you to inform the users of your input to use capitalized characters when they want to ignore conversion. You could make a PR for WaniKani adding a new option to
I think that would probably do it. FYI: |
Thank you very much for your help, @DJTB. Isn't capitalization important, for typing both hiragana and katakana in the same input? As for making a Pull Request, I am still getting my way around coding and GitHub. I will have to study it a bit more before doing something that I do not quite understand, yet. In the meantime, would it be acceptable to post a feature request on the issues page, linking it to this post? I am not sure I can explain the possible solution you presented by myself. Also, is there something I can do, locally, to fix the issue? Like a javascript function, in my page, that overrides the way wanakana usually works. |
As for capitalization, I was making an assumption based on this:
I'm not sure what you will be doing with the result from the input, so maybe that's not feasible.
You're more than welcome to. If capitalization is important to your input it probably makes more sense to add the methods
Unfortunately not if you're using |
Question
I am pretty new to wanakana, github, and coding in general, so if I am posting in th wrong place, please let me know.
I am trying to create an input where the user can type things like:
その NASA は なん です か。
I gave the input a class that I toggle when pressing the AltGr key. Then, I check if the input has that class in order to bind, or unbind wanakana, thus making it possible to write romaji in that input. However, when I press the AltGr key again, to start writing kana again, all the romaji are converted to japanese characters.
This is my code:
https://codepen.io/goldenPunk/pen/PoPyxVN
I have tried having
wanakana.bind(x, { passRomaji: true });
instead of justwanakana.bind(x);
but I still get no results.I have tested it on both Chrome and Firefox's most recent versions. None works as I would like it to.
Is it possible to have two different scripts on the same text input? Am I doing something wrong?
The text was updated successfully, but these errors were encountered: