File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ const isQueryContinuation = computed(() => {
108108 return previous && current .startsWith (previous )
109109})
110110
111+ const resultsMatchQuery = computed (() => {
112+ return previousQuery .value === query .value
113+ })
114+
111115// Show cached results while loading if it's a continuation query
112116const rawVisibleResults = computed (() => {
113117 if (status .value === ' pending' && isQueryContinuation .value && cachedResults .value ) {
@@ -553,7 +557,10 @@ watch(unifiedSelectedIndex, unified => {
553557watch (
554558 [visibleResults , validatedSuggestions , exactMatchType ],
555559 () => {
556- if (userHasNavigated .value ) return
560+ if (userHasNavigated .value ) {
561+ unifiedSelectedIndex .value = clampUnifiedIndex (unifiedSelectedIndex .value )
562+ return
563+ }
557564
558565 if (exactMatchType .value === ' package' ) {
559566 // Find the exact match package index
@@ -649,6 +656,8 @@ function handleResultsKeydown(e: KeyboardEvent) {
649656 }
650657
651658 if (e .key === ' Enter' ) {
659+ if (! resultsMatchQuery .value ) return
660+
652661 const suggIdx = toSuggestionIndex (unifiedSelectedIndex .value )
653662 const pkgIdx = toPackageIndex (unifiedSelectedIndex .value )
654663
You can’t perform that action at this time.
0 commit comments