Skip to content

Commit 2309b67

Browse files
chore(web): Disable page scroll when using arrow keys on search suggestions box (#493)
1 parent a74d070 commit 2309b67

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
- Disable page scroll when using arrow keys on search suggestions box. [#493](https://github.com/sourcebot-dev/sourcebot/pull/493)
12+
1013
## [4.6.6] - 2025-09-04
1114

1215
### Added

packages/web/src/app/[domain]/components/searchBar/searchSuggestionsBox.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,15 @@ const SearchSuggestionsBox = forwardRef(({
334334
}
335335

336336
if (e.key === 'ArrowUp') {
337+
e.preventDefault();
337338
e.stopPropagation();
338339
setHighlightedSuggestionIndex((curIndex) => {
339340
return curIndex <= 0 ? suggestions.length - 1 : curIndex - 1;
340341
});
341342
}
342343

343344
if (e.key === 'ArrowDown') {
345+
e.preventDefault();
344346
e.stopPropagation();
345347
setHighlightedSuggestionIndex((curIndex) => {
346348
return curIndex >= suggestions.length - 1 ? 0 : curIndex + 1;

0 commit comments

Comments
 (0)