fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Unpredictable behavior when using a Japanese IME (or one using composition strings) with a ComboBox with allowFreeform and autoComplete

Open bencaratms opened this issue 5 years ago • 5 comments

Environment Information

  • Package version(s): fluentui/react 8.10.0, 8.14.6
  • Browser and OS versions: Edge 90.0.818.56, Win10 19403.985 (also reported but unconfirmed: Chrome, FireFox, Google Japanese IME)

Please provide a reproduction of the bug in a codepen:

  1. Configure your OS to have a language that has a keyboard that uses composition strings, for example Japanese.
    • Win10 OS Settings > Time & Language > Language
    • Add language
    • Choose Japanese and continue to install the package. This usually involves a download and installation of the localized package.
    • There is no need to make Japanese the default language, but the keyboard should be installed (notice a language switcher on the taskbar next to the clock).
  2. Open https://codepen.io/bencaratms/pen/KKWVRzN
  3. "11:00" should already be selected. Put keyboard focus on the control and place the cursor at the end of the string.
  4. Switch the IME, if necessary, to Japanese and Hiragana using the controls in the taskbar.
    • Switch first to Japanese if not already using that language (e.g. click on "ENG" and choose "Japanese")
    • Click on "A", and it should switch to Hiragana.
    • Note that different input boxes can reset this, so be sure it's set to Hiragana when typing in the ComboBox.
  5. Backspace twice so that "11:" remains, and type the key "1" (result two "1" characters are entered)
  6. Delete the two "1" characters so that "11:" remains with the cursor after the colon.
  7. Type "1" again (the candidate menu appears as expected, but the cursor is located before the "1" that was just typed).
  8. Press the down arrow to select "15" from the menu (the string becomes "11151" instead of "11:15")
  9. Press ENTER to commit the composition string (the string becomes "11551")

Actual behavior:

The actual behavior is described above in the repro steps. It seems like the ComboBox is being confused by composition string input.

A workaround is to use the alphanumeric input with the control, but note that the user must never (from control load) use Hiragana with the control or it will continue to exhibit unpredictable behavior.

Expected behavior:

My expectation is that the input is undisturbed while using the composition string input until the commit, but I'm neither a native speaker of one of these languages nor an expert on the subject. At the very least, the behavior should be made predictable for a user using an IME that uses composition strings.

Priorities and help requested:

Are you willing to submit a PR to fix? No

Requested priority: Normal

Products/sites affected: Outlook Web Access, Outlook.com

Additional Information

bencaratms avatar May 12 '21 23:05 bencaratms

Thanks for the detailed info! This is more likely to be related to (maybe a duplicate of) #17914 since most of the internals of Dropdown and ComboBox are different. (EDIT: #17760 is actually about the northstar dropdown, so definitely unrelated.)

One question, do you know if this ever worked in the past?

ecraig12345 avatar May 13 '21 01:05 ecraig12345

This started to repro when moving fluentui/react from 7.158.3 to 8.8.0, but there was also removing the last bits of fabricui in that change too. So, I'm not sure which is more relevant.

bencaratms avatar May 13 '21 03:05 bencaratms

Here's a version of the example on office-ui-fabric 7 where the interaction with the IME seems to work correctly.

bencaratms avatar May 13 '21 03:05 bencaratms

@bencaratms Thanks! @TristanWatanabe Since this is a regression from 7 to 8 and an important feature for a lot of people, it should be high priority to address.

ecraig12345 avatar May 13 '21 16:05 ecraig12345

This issue also affects Microsoft Dynamics with thousands of Japanese users. Is there anything I can do to help get #18186 in?

tahoon-ms avatar Oct 15 '21 16:10 tahoon-ms