From 6d84ddf25fce252e444827960f52f05522abac7a Mon Sep 17 00:00:00 2001 From: mantou <709922234@qq.com> Date: Mon, 18 Mar 2024 22:06:18 +0800 Subject: [PATCH] fix: `` in ShadowDOM will open docsearch --- packages/docsearch-react/src/useDocSearchKeyboardEvents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts b/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts index a23aab1cd..6b3c44a5e 100644 --- a/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts +++ b/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts @@ -9,7 +9,7 @@ export interface UseDocSearchKeyboardEventsProps { } function isEditingContent(event: KeyboardEvent): boolean { - const element = event.target as HTMLElement; + const element = event.composedPath()[0] as HTMLElement; const tagName = element.tagName; return (