Skip to content

AutocompleteUI: Forward slash inserter doesn't work in Japanese #45496

@t-hamano

Description

@t-hamano

Description

At least in the Japanese input system, the block list are not properly filtered when using the forward slash inserter.

Because of the vast number of characters in the Japanese language ( including Kanji), it is not possible to input characters directly on a standard keyboard. Therefore, after entering "hiragana" characters, we choose which character to convert to and confirm with the Enter key.

In WordPress 6.0, the autocomplete popover is retained after we press Enter to "submit" a candidate, allowing me to select the block that matches the keyword.

In WordPress 6.1, the forward slash inserter no longer works because the block at the beginning of the candidate is inserted the moment I press the enter key. However, autocomplete works correctly when pasting a string containing forward slashes.

I believe this problem also occurs in languages where character output must be confirmed with the Enter key, for example Chinese.

Step-by-step reproduction instructions

Since this test requires the use of Japanese input for keyboard input, I expect users to test the Japanese keyboard.

  • Change the site language to Japanese (日本語).
  • On the block editor, type /みだし. みだし is a hiragana character used to convert the Japanese translation of "heading" into 見出し.
  • Confirm that the autocomplete popover disappears and the block at the top of the list is inserted unintentionally when the Enter key is pressed to convert it to 見出し

Screenshots, screen recording, code snippet

WordPress 6.0

  1. Autocomplete works correctly when pasting a string containing forward slashes
  2. Autocomplete works correctly when the block name "heading" is entered
  3. Autocomplete works correctly even if the enter key is pressed to convert the Japanese name of a block in Japanese input
86299a2cd39c93634ff9377e67a6bb99.mp4

WordPress 6.1 (with / without Gutenberg Plugin)

  1. Autocomplete works correctly when pasting a string containing forward slashes
  2. Autocomplete works correctly when the block name "heading" is entered
  3. Autocomplete DOESN'T work correctly when the Enter key is pressed to convert to the Japanese name of a block in Japanese input
dca35f0c00afd7e459509104d818533a.mp4

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

Internationalization (i18n)Issues or PRs related to internationalization efforts[Package] Block editor/packages/block-editor[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions