mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
chore(web): Disable page scroll when using arrow keys on search suggestions box (#493)
This commit is contained in:
parent
a74d070775
commit
2309b67999
2 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- Disable page scroll when using arrow keys on search suggestions box. [#493](https://github.com/sourcebot-dev/sourcebot/pull/493)
|
||||
|
||||
## [4.6.6] - 2025-09-04
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -334,6 +334,7 @@ const SearchSuggestionsBox = forwardRef(({
|
|||
}
|
||||
|
||||
if (e.key === 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setHighlightedSuggestionIndex((curIndex) => {
|
||||
return curIndex <= 0 ? suggestions.length - 1 : curIndex - 1;
|
||||
|
|
@ -341,6 +342,7 @@ const SearchSuggestionsBox = forwardRef(({
|
|||
}
|
||||
|
||||
if (e.key === 'ArrowDown') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setHighlightedSuggestionIndex((curIndex) => {
|
||||
return curIndex >= suggestions.length - 1 ? 0 : curIndex + 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue