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

Windows Firefox Japanese input get broken #1135

Closed
tats-u opened this issue Apr 30, 2023 · 26 comments · Fixed by #1226 or #1238
Closed

Windows Firefox Japanese input get broken #1135

tats-u opened this issue Apr 30, 2023 · 26 comments · Fixed by #1226 or #1238

Comments

@tats-u
Copy link

tats-u commented Apr 30, 2023

Description

Reproduction

https://www.algolia.com/doc/ui-libraries/autocomplete/introduction/what-is-autocomplete/

Steps

  1. Click the 2nd search bar (1st one works well)
  2. Input some alphabets or numbers
  3. Turn Japanese IME on
  4. Try to input Japanese
  5. Input canceled
ime_canceled.mp4

Expected behavior

↓Search bar just above

autocomplete_success.mp4

Other browsers (Chromium-based) work well.

Environment

  • OS: Windows
  • Browser: Firefox (Chrome & Edge work well)
  • Autocomplete version: [e.g. 1.0.0]
@tats-u
Copy link
Author

tats-u commented May 2, 2023

I found the enterkeyhint attribute of the <input> element is changed from search to go at the moment my IME is interrupted.

@Haroenv
Copy link
Contributor

Haroenv commented May 2, 2023

I believe #901 may fix this, can you check that @tats-u ?

@tats-u
Copy link
Author

tats-u commented May 2, 2023

It's plan is not so different, but its current change is not effective on this issue.

@tats-u
Copy link
Author

tats-u commented May 2, 2023

It's required to consider isComposing to fix this issue, too, though.

@tats-u
Copy link
Author

tats-u commented May 2, 2023

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

enterkeyhint_firefox.mp4

(↓Chrome)

enterkeyhint_chrome.mp4

@tats-u
Copy link
Author

tats-u commented May 3, 2023

Maybe a bug of Firefox
https://bugzilla.mozilla.org/show_bug.cgi?id=1831015

@FabienMotte
Copy link
Contributor

FabienMotte commented May 3, 2023

Hello @tats-u, thanks for reporting this issue!

I can't replicate the issue on my end, using Firefox v112.0.2 and OSX 12.6.3 with a Japanese (Romaji) keyboard. Am I replicating the steps correctly?

Seems to be specifically related to Firefox for Windows.

Screen.Recording.2023-05-03.at.16.16.32.mov

Thank you!

@tats-u
Copy link
Author

tats-u commented May 3, 2023

If you can input hiraganas other than あ, い, う, え, and お, your browser isn't affected.
E.g. "た" is composed of T + A, so if the browser were affected, it'd be "tあ".

I found Android is also affected.
Linux is unknown as of now. Not affected (Ubuntu 20.04)
iOS Firefox is not Gecko but WebKit.

@tats-u
Copy link
Author

tats-u commented May 3, 2023

Available choices:

  • Suppress the change of enterkeyhint while composing (we can choose whether we enable this behavior in response to the user agent; if there is "Safari" or "Mac OS X", not affected)
  • Wait until Firefox might fix this bug

@Haroenv
Copy link
Contributor

Haroenv commented May 3, 2023

I believe the new approach in #901 may fix this, can you try the deploy preview once it runs?

@tats-u
Copy link
Author

tats-u commented May 3, 2023

I think it's effective.
It won't spoil the search experience unless how kanji's are read and how hiragana's and katakana's are spelled into romaji are taken into.

E.g.

image

Google knows the relations: 検索→けんさく→kensaku & 腱鞘炎→けんしょうえん→kensho(u)en
Suggests while composing don't make sense until the search engine doesn't understand relations like above.

@tats-u
Copy link
Author

tats-u commented May 8, 2023

CodeSandBox CI is not latest.
Do you know how to make it rebuild?
And all other than @algolia/autocomplete-example-react-renderer don't work.

@FabienMotte
Copy link
Contributor

@tats-u It should be good now!

@tats-u
Copy link
Author

tats-u commented May 9, 2023

CodeSandBox isn't still fresh and I can't try; diff looks great though

@FabienMotte
Copy link
Contributor

@tats-u
Copy link
Author

tats-u commented May 11, 2023

@FabienMotte I'm afraid it's been NEVER improved AT ALL.
R and A (あ) mustn't be disjointed like this.

not_improved.mp4

What I've modified is just appending of the 3rd entry.

https://codesandbox.io/s/algolia-autocomplete-example-starter-forked-sdo4b3?file=/app.tsx

@TheKonka
Copy link

TheKonka commented Oct 1, 2023

Meeting the same problem when input chinese in Windows Firefox. Avoid the change of enterkeyhint seems can solve the problem at present.

const enterKeyHint =
props.enterKeyHint ||
(activeItem?.itemUrl && !shouldFallbackKeyHint ? 'go' : 'search');

@aymeric-giraudet
Copy link
Member

Seems to work well on Firefox as well, here with Pinyin, I believe it would be the same for Japanese with romaji :

Screen.Recording.2024-01-03.at.17.26.41.mov

I can only test on Mac though so if you could try on Windows please @TheKonka, you can try right there : https://codesandbox.io/s/algolia-autocomplete-example-react-renderer-lt4cr9

@TheKonka
Copy link

TheKonka commented Jan 6, 2024

@aymeric-giraudet I've tested it on window, no problem, it's great!

@tats-u
Copy link
Author

tats-u commented Jan 7, 2024

@aymeric-giraudet Now works well in Windows + Firefox + Google Japanese Input.

@tats-u
Copy link
Author

tats-u commented Jan 8, 2024

I am looking forward to the release of v1.13.1.

@Haroenv
Copy link
Contributor

Haroenv commented Jan 9, 2024

We've found a regression in InstantSearch which uses the same code, where "text suggestions" in Samsung phones unfortunately don't correctly search anymore, so we'll fix that first

@tats-u
Copy link
Author

tats-u commented Jan 10, 2024

That is bad news but I am looking forward to a fix.

@Haroenv
Copy link
Contributor

Haroenv commented Jan 16, 2024

Of course if you don't support Samsung, you can still rely on the already shared patch, but as we reverted the fix, I'll reopen this until it's back

@Haroenv Haroenv reopened this Jan 16, 2024
@tats-u
Copy link
Author

tats-u commented Jan 20, 2024

Track: algolia/instantsearch#5986

@dhayab
Copy link
Member

dhayab commented Jan 30, 2024

Hi, you can now update to autocomplete v1.15.1 and set the ignoreCompositionEvents option in order to ignore input events during a composition session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment