diff --git a/packages/docsearch-core/src/useDocSearchKeyboardEvents.ts b/packages/docsearch-core/src/useDocSearchKeyboardEvents.ts index 14ab0f84..569a5e17 100644 --- a/packages/docsearch-core/src/useDocSearchKeyboardEvents.ts +++ b/packages/docsearch-core/src/useDocSearchKeyboardEvents.ts @@ -27,7 +27,13 @@ function isEditingContent(event: KeyboardEvent): boolean { const element = event.composedPath()[0] as HTMLElement; const tagName = element.tagName; - return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || tagName === 'BUTTON'; + return ( + element.isContentEditable || + tagName === 'INPUT' || + tagName === 'SELECT' || + tagName === 'TEXTAREA' || + tagName === 'BUTTON' + ); } export function useDocSearchKeyboardEvents({ diff --git a/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts b/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts index f9fcb3be..bcaceeb0 100644 --- a/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts +++ b/packages/docsearch-react/src/useDocSearchKeyboardEvents.ts @@ -28,7 +28,13 @@ function isEditingContent(event: KeyboardEvent): boolean { const element = event.composedPath()[0] as HTMLElement; const tagName = element.tagName; - return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || tagName === 'BUTTON'; + return ( + element.isContentEditable || + tagName === 'INPUT' || + tagName === 'SELECT' || + tagName === 'TEXTAREA' || + tagName === 'BUTTON' + ); } export function useDocSearchKeyboardEvents({ diff --git a/packages/docsearch-sidepanel-js/src/sidepanel.tsx b/packages/docsearch-sidepanel-js/src/sidepanel.tsx index 37c501b0..cb4ed45a 100644 --- a/packages/docsearch-sidepanel-js/src/sidepanel.tsx +++ b/packages/docsearch-sidepanel-js/src/sidepanel.tsx @@ -1,5 +1,5 @@ import type { DocSearchRef, InitialAskAiMessage } from '@docsearch/core'; -import type { DocSearchSidepanelProps } from '@docsearch/react/sidepanel'; +import type { DocSearchSidepanelProps, SidepanelSearchParameters } from '@docsearch/react/sidepanel'; import { DocSearchSidepanel } from '@docsearch/react/sidepanel'; import { render, createElement, unmountComponentAtNode, createRef } from 'preact/compat'; @@ -32,7 +32,8 @@ export interface SidepanelCallbacks { } export type SidepanelProps = DocSearchSidepanelProps & - SidepanelCallbacks & { + SidepanelCallbacks & + SidepanelSearchParameters & { container: HTMLElement | string; environment?: typeof window; };