Skip to content
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

Can't input Japanese on docusaurus-theme-search-algolia in Windows Firefox #8952

Open
2 of 7 tasks
tats-u opened this issue Apr 30, 2023 · 18 comments
Open
2 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.

Comments

@tats-u
Copy link
Contributor

tats-u commented Apr 30, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

docusaurus-theme-search-algolia has a bug to prevent from inputting Japanese in Windows Firefox.
Other languages, e.g. Chinese, may be affected, too.
Chromium-based browsers work well.

Reproducible demo

https://docusaurus.io/

Steps to reproduce

  1. Install or enable a Japanese input method (e.g. Google Japanese Input)
  2. Click the search bar or Ctrl + K
  3. Enable Japanese input method
  4. Type some Japanese search query

Expected behavior

search_edge.mp4

(Edge)

Chrome also works well.

Note: this movie uses AV1. Safari may not be supported. Edge requires an this Windows video extension.

Actual behavior

search_firefox.mp4

Input corrupted at every moment😡

Your environment

  • Public source code: officia pagel
  • Public site URL: official page
  • Docusaurus version used: official
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): N/A
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows + Firefox

Self-service

  • I'd be willing to fix this bug myself.
@tats-u tats-u added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 30, 2023
@tats-u
Copy link
Contributor Author

tats-u commented Apr 30, 2023

https://developer.mozilla.org/docs/Web/API/Event/composed must be used to fix this problem.

This may be due to https://github.com/algolia/autocomplete

@Josh-Cena
Copy link
Collaborator

I cannot reproduce this in macOS Firefox, but Chinese input methods work differently and I don't know how to use the Hiragana input method... In any case, Docusaurus does not provide the search modal, so we will track algolia/autocomplete#1135 instead.

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2023
@Josh-Cena Josh-Cena added external This issue is caused by an external dependency and not Docusaurus. and removed status: needs triage This issue has not been triaged by maintainers labels Apr 30, 2023
@tats-u
Copy link
Contributor Author

tats-u commented Apr 30, 2023

@Josh-Ce I don't have a mac, but can't it be reproduced in Microsoft Pinyin in Windows parallels either? (I'll try it later in physical Windows though)

@Josh-Cena
Copy link
Collaborator

Unfortunately I don't have access to a Windows machine either :/

@tats-u
Copy link
Contributor Author

tats-u commented Apr 30, 2023

fyi how to enable Japanese IME in macOS

https://redcocoon.org/cab/mysoft.html

@Josh-Cena
Copy link
Collaborator

Yeah I do have the Hiragana keyboard, I just never know how to use it.

Test

@tats-u
Copy link
Contributor Author

tats-u commented May 1, 2023

Seems to work well.
It may be Windows specific.

@tats-u
Copy link
Contributor Author

tats-u commented May 1, 2023

I was able to test in Google Pinyin in Windows Sandbox.

googlepinyin.mp4

Input a sentence→Press backspace until all characters are deleted
While I pressed backspace, I found the search bar behaves suspiciously (as if I pressed a space).

woxihuan→[backspace]→・・・→woxih (OK until here)→[backspace]→我系 (IME closed; I can't modify pinyin anymore)

googlepinyin2.mp4

Another example (I just pressed backspace once after typing huanghe)

Google Pinyin: 下载谷歌拼音输入法 Download Google Pinyin Chinese Mandarin Pinyin Input (Direct link: Download Google Pinyin [ 标准版 ] For Microsoft Windows | GeckoandFly Server)

@tats-u
Copy link
Contributor Author

tats-u commented May 2, 2023

Can macOS + Firefox input Pinyin on the field in this pen successfully?

https://codepen.io/tats-u/pen/KKGXxEM

@Josh-Cena
Copy link
Collaborator

@tats-u sorry I was quite busy for the last few weeks. Yes, the pen works for me on Mac Firefox, both using Chinese and Hiragana keyboards.

The IME closing seems unexpected, but I can't reproduce it here. Maybe it's a platform-specific issue?

@tats-u
Copy link
Contributor Author

tats-u commented May 24, 2023

macOS doesn't seem to be affected. Thank you for your cooperation.

FYI in Windows:

enterkeyhint_firefox.mp4

@tats-u
Copy link
Contributor Author

tats-u commented Mar 19, 2024

algolia/autocomplete#1135 (comment)

We will be able to fix this issue by ignoreCompositionEvents in the latest autocomplete for CJK languages.

@Josh-Cena Now that the ball is in our court, could you reopen this issue?

@Josh-Cena Josh-Cena reopened this Mar 24, 2024
@Josh-Cena
Copy link
Collaborator

@tats-u Could you try it in your environment? Thanks!

@tats-u
Copy link
Contributor Author

tats-u commented Mar 24, 2024

Has it been committed in main? It does not look like.

@Josh-Cena
Copy link
Collaborator

Ah, no, I meant if you wanted to make the code change and test it locally.

@tats-u
Copy link
Contributor Author

tats-u commented Mar 25, 2024

I see.
I found that we still have to wait for fix of algolia/docsearch#1043 & algolia/docsearch#1304.
That attribute has not been imported into <DocSearchModal/> (@docsearch/react) yet.

We have only to add a line in packages\docusaurus-theme-search-algolia\src\theme\SearchBar\index.tsx.

Should we use useDocusaurusContext().i18n.currentLocale to check if that attribute should be designated?

@Josh-Cena
Copy link
Collaborator

Is there a downside to this being unconditionally applied?

@tats-u
Copy link
Contributor Author

tats-u commented Mar 25, 2024

You may want to see:

algolia/instantsearch#5986
algolia/instantsearch#6009

It is up to your team to apply this to all locales. I am against their background, though. The detailed condition (the name of Ithe keyboard app & the language of the keyboard) is not written.
I think Gboard (English & Japanese) for Pixel works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

2 participants