Skip to content

Commit 6ba5e54

Browse files
add isComposing to search (#4244)
1 parent 56aeb19 commit 6ba5e54

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

.changeset/great-candies-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Support isComposing for search

bun.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/gitbook/src/components/Search/useSearchController.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function useSearchKeyboardNavigation(props: {
8181
} else if (event.key === 'ArrowDown') {
8282
event.preventDefault();
8383
moveCursorBy(1);
84-
} else if (event.key === 'Enter') {
84+
} else if (event.key === 'Enter' && !event.nativeEvent.isComposing) {
8585
event.preventDefault();
8686
if (cursor !== null && cursor >= results.length) {
8787
onAskSelect(cursor - results.length);

0 commit comments

Comments
 (0)