Skip to content

Commit 6409b0f

Browse files
shivamhwpclaude
andcommitted
fix(web): guard sidebar search keys during IME composition, untab options
Committing an IME candidate no longer moves the highlight or navigates away mid-compose, and search result options use tabIndex={-1} so focus stays on the input that owns the aria-activedescendant keyboard model. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 996934f commit 6409b0f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/web/src/components/SidebarV2.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,9 @@ const SidebarV2SearchResultRow = memo(function SidebarV2SearchResultRow(props: {
11211121
id={props.resultId}
11221122
type="button"
11231123
role="option"
1124+
// aria-activedescendant options: focus stays on the search input,
1125+
// which owns all keyboard interaction for the listbox.
1126+
tabIndex={-1}
11241127
aria-selected={props.isHighlighted}
11251128
aria-current={props.isRouteActive ? "page" : undefined}
11261129
aria-label={
@@ -1830,6 +1833,9 @@ export default function SidebarV2() {
18301833
);
18311834
const handleThreadSearchKeyDown = useCallback(
18321835
(event: ReactKeyboardEvent<HTMLInputElement>) => {
1836+
// IME composition (Japanese/Chinese input) uses the same keys; committing
1837+
// a candidate must not move the highlight or navigate away mid-compose.
1838+
if (event.nativeEvent.isComposing || event.keyCode === 229) return;
18331839
if (event.key === "Escape" && isSearchingThreads) {
18341840
event.preventDefault();
18351841
event.stopPropagation();

0 commit comments

Comments
 (0)