I can’t input some characters, in particular when I’m trying to put in some kaomoji…
if I hit enter here, nothing happens. if I remove the character I called out, then I can enter the card name. btw, I can click away and the card will be saved too.
つ as in ⊂(◉‿◉)つ ツ as in ¯_(ツ)_/¯ノas in┬─┬ ノ( ゜-゜ノ)`
this is deliberate, due to an issue inputting japanese characters for native writers.
On japanese keyboards, the enter key is used to switch between katakana and hiragana. So having enter make a new card in that case would break their typing experience. So instead, a check is performed: if the card only contains japanese characters then enter won’t create a new card.
you can save the card by clicking anywhere else. Also, if there are english characters in their too it should work.
this is the code I’m using to detect whether the string contains japanese (it’s based on unicode character ranges)
nameContainsJapanese (name) {
if (!name) { return }
// https://regexr.com/5n78p
// matches unicode ranges for hiragana, katana, kanji
const japanesePattern = new RegExp(/[\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/gmi)
const japanese = name.match(japanesePattern)
return Boolean(japanese)
},
despite characters like / looking like the english /, they’re in fact distinct characters with different code points. So basically, every character in ¯\_(ツ)_/¯ is interpreted as a japanese character
That said I could totally add whitelist exceptions for cards that just contain the shrug or a couple common kaomojis, if you think you’ll use them often enough that it’ll be annoying
it’s not a huge deal. I was curious what you meant specifically by “if there are english characters in their too it should work.” from the looks of the code, if you detect any Japanese characters, then you will suppress the Enter
good catch! I just asked the original native Japanese issue poster if switching from suppressing ‘enter’ if there’s ANY characters to requiring ALL characters would cause an issue.
cool, also (and I have no idea how the japanese keyboard input mechanism works), but what if you detect two (or more) enters in a row to close the card?
I can’t think of a good one, but is there way to indicate to the user why hitting Enter is not working?
if I can switch to ALL characters, the enter key should work as intended in these kaomoji cases. According to regexr, not all characters are japanese in the kaomoji cases above
that would be nice. it is weird and frustrating when it seems like all-of-a-sudden Enter doesn’t work. I can’t think of a super-elegant way, but this is probably pretty niche so might not need to be elegant.
other thoughts/ideas:
it seems like hitting escape is suppressed too. would it be okay to allow that as another way to get out of editing mode?
another option I tried was tabbing out of the textarea and then it took me to the checklist button. what if there were an save/enter/post button? that’s a big change, but just vocalizing my thought process.
The first time in a space when someone tries to hit Enter on an a card with mixed-JP content, you could use a little pop-up message in the bottom corner (the same component as the “Kinopio has been updated” one) to say, “Hey, it looks like you’re using JP characters. Click outside the card to finish typing instead of pressing Enter”
I like that idea. I was thinking a message local to the edit card dialog, but the general notification toast thing works better. And I would personally be okay if this happened every time you hit Enter on a card with japanese characters.
you could then implement an easter egg where if you keep hitting enter, you start getting progressively passive aggressive messages (“i told you to click away” “you’re still here huh?” “hit enter again, i dare you”, etc) (͡ ° ͜ʖ ͡ °)
I like ‘first time’ instead of ‘every time’ because every would be annoying to deliberately japanese typers.
you could then implement an easter egg where if you keep hitting enter, you start getting progressively passive aggressive messages (“i told you to click away” “you’re still here huh?” “hit enter again, i dare you”, etc) (͡ ° ͜ʖ ͡ °)
lol reminds me of warcraft3
I’m leaning to a card specific indicator though just because it clearly informs (like the one time notification), but is not forgettable and is contextual (which is the issue an every time notification would be addressing).
Not sure of the exact implementation though yet, will work on this soonish
maybe the copy can tell the user how to proceed (actionable): "The Enter key is disabled to allow switching between Hiragana and Katakana. Click away or hit Esc to save. "
seeing the new button made me wonder: what if upon detection, you put a button next to the text area to the right? kinda like a save button that the user could tab to? then, the user could Tab, Enter to save. dunno if that’s a good idea or worth it for this niche case.