Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/react-aria/src/autocomplete/useAutocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,14 @@ export function useAutocomplete<T>(
let onChange = (value: string) => {
// Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via
// copy paste/backspacing/undo/redo for screen reader announcements
if (lastInputType.current === 'insertText' && !disableAutoFocusFirst) {
if (
(lastInputType.current === 'insertText' ||
// IME composition (e.g. CJK input) reports 'insertCompositionText'/'insertFromComposition'
// instead of 'insertText'. Treat these as forward typing so the first item gets virtual focus.
lastInputType.current === 'insertCompositionText' ||
lastInputType.current === 'insertFromComposition') &&
!disableAutoFocusFirst
) {
focusFirstItem();
} else if (
lastInputType.current &&
Expand Down