Skip to content

fix(composition): do not submit when user is composing#901

Closed
Haroenv wants to merge 3 commits intonextfrom
fix/composing
Closed

fix(composition): do not submit when user is composing#901
Haroenv wants to merge 3 commits intonextfrom
fix/composing

Conversation

@Haroenv
Copy link
Copy Markdown
Contributor

@Haroenv Haroenv commented Feb 21, 2022

"composing" is used on Japanese (and other CJK scripts) when typing on a qwerty or similar keyboard, showing something akin to autocomplete on iOS. You confirm a word by pressing enter, which shouldn't commit to a search.

Still needs to be tested thoroughly, as it's possible we need to check isComposing earlier to prevent searching for the intermediate romaji characters.

Fixes algolia/docsearch#1304
Fixes algolia/docsearch#1043
Fixes #1135

"composing" is used on Japanese (and other CJK scripts) when typing on a qwerty or similar keyboard, showing something akin to autocomplete on iOS. You confirm a word by pressing enter, which shouldn't commit to a search.

Still needs to be tested thoroughly, as it's possible we need to check isComposing earlier to prevent searching for the intermediate romanji characters.

Fixes algolia/docsearch#1304
Fixes algolia/docsearch#1043
@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Feb 21, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ffe7771:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration

@sarahdayan
Copy link
Copy Markdown
Member

sarahdayan commented Apr 12, 2022

Thanks @Haroenv for opening this ticket, let's try to move it forward.

From what I understand of this isComposing API, it triggers in any situation where a user is considered in a "composition session" (e.g., in Pinyin IME as on the linked DocSearch issue, when typing a letter modifier such as "`" or "~").

Should we consider not triggering any input event (no searches, no navigations, etc.) when a user is still composing? Looking at algolia/docsearch#1304, it seems confusing for users to have both autocompletes update at the same time, and that both seem to have focus and receive commands.

It'd feel cleaner not to trigger anything when the user is in a composition session, and only do so when they exit it.

Happy to hear opinions, cc @francoischalifour @Haroenv @dhayab.

@francoischalifour
Copy link
Copy Markdown
Contributor

@sarahdayan I'm not familiar with accessibility regarding composing. This is the kind of feature that we shouldn't guess by ourselves, but rather follow accessibility recommendations for combobox/autocomplete experiences.

Comment thread packages/autocomplete-core/src/onKeyDown.ts Outdated
@dhayab
Copy link
Copy Markdown
Member

dhayab commented Dec 15, 2023

This fix is integrated and tested in #1226.

@dhayab dhayab closed this Dec 15, 2023
@Haroenv Haroenv deleted the fix/composing branch December 15, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants