1
0
Fork 0

fix: <input> in ShadowDOM will open docsearch (#2212)

Co-authored-by: Paul Jankowski <33367713+8bittitan@users.noreply.github.com>
This commit is contained in:
mantou 2025-03-15 04:53:27 +08:00 committed by GitHub
parent c591f00442
commit ec351710b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';