fix: error out when arrow key navigation done on spotlight when no results
This commit is contained in:
@@ -67,6 +67,7 @@
|
|||||||
"jsonpath-plus": "^7.0.0",
|
"jsonpath-plus": "^7.0.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"lossless-json": "^2.0.8",
|
"lossless-json": "^2.0.8",
|
||||||
|
"minisearch": "^6.1.0",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"paho-mqtt": "^1.1.0",
|
"paho-mqtt": "^1.1.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ function newUseArrowKeysForNavigation() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const onArrowDown = () => {
|
const onArrowDown = () => {
|
||||||
|
// If no entries, do nothing
|
||||||
|
if (scoredResults.value.length === 0) return
|
||||||
|
|
||||||
const [sectionIndex, entryIndex] = selectedEntry.value
|
const [sectionIndex, entryIndex] = selectedEntry.value
|
||||||
|
|
||||||
const [, section] = scoredResults.value[sectionIndex]
|
const [, section] = scoredResults.value[sectionIndex]
|
||||||
@@ -159,6 +162,9 @@ function newUseArrowKeysForNavigation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onArrowUp = () => {
|
const onArrowUp = () => {
|
||||||
|
// If no entries, do nothing
|
||||||
|
if (scoredResults.value.length === 0) return
|
||||||
|
|
||||||
const [sectionIndex, entryIndex] = selectedEntry.value
|
const [sectionIndex, entryIndex] = selectedEntry.value
|
||||||
|
|
||||||
if (entryIndex > 0) {
|
if (entryIndex > 0) {
|
||||||
|
|||||||
27
pnpm-lock.yaml
generated
27
pnpm-lock.yaml
generated
@@ -509,6 +509,9 @@ importers:
|
|||||||
lossless-json:
|
lossless-json:
|
||||||
specifier: ^2.0.8
|
specifier: ^2.0.8
|
||||||
version: 2.0.8
|
version: 2.0.8
|
||||||
|
minisearch:
|
||||||
|
specifier: ^6.1.0
|
||||||
|
version: 6.1.0
|
||||||
nprogress:
|
nprogress:
|
||||||
specifier: ^0.2.0
|
specifier: ^0.2.0
|
||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
@@ -5833,8 +5836,8 @@ packages:
|
|||||||
vue-i18n:
|
vue-i18n:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/message-compiler': 9.3.0-beta.21
|
'@intlify/message-compiler': 9.3.0-beta.24
|
||||||
'@intlify/shared': 9.3.0-beta.21
|
'@intlify/shared': 9.3.0-beta.24
|
||||||
jsonc-eslint-parser: 1.4.1
|
jsonc-eslint-parser: 1.4.1
|
||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
vue-i18n: 9.2.2(vue@3.2.37)
|
vue-i18n: 9.2.2(vue@3.2.37)
|
||||||
@@ -5895,11 +5898,11 @@ packages:
|
|||||||
source-map-js: 1.0.2
|
source-map-js: 1.0.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@intlify/message-compiler@9.3.0-beta.21:
|
/@intlify/message-compiler@9.3.0-beta.24:
|
||||||
resolution: {integrity: sha512-0h3D9AYKW037bfg4OArPKPYPShoWyjWco0DZBD7ASwXsQ8YlplW2HJSRW5V5hgsHpD25ghSRIpFhPPTL0A+QEw==}
|
resolution: {integrity: sha512-prhHATkgp0mpPqoVgiAtLmUc1JMvs8fMH6w53AVEBn+VF87dLhzanfmWY5FoZWORG51ag54gBDBOoM/VFv3m3A==}
|
||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/shared': 9.3.0-beta.21
|
'@intlify/shared': 9.3.0-beta.24
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.0.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -5912,8 +5915,8 @@ packages:
|
|||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@intlify/shared@9.3.0-beta.21:
|
/@intlify/shared@9.3.0-beta.24:
|
||||||
resolution: {integrity: sha512-VcE3XKBlQXHKRKAGP7YB/7n0TFH4EibJSGJ+t4rZuC8gTL6r/eqYM1fsw3JJFe70wamqx1oEmd2Hu/pnPlsfiQ==}
|
resolution: {integrity: sha512-AKxJ8s7eKIQWkNaf4wyyoLRwf4puCuQgjSChlDJm5JBEt6T8HGgnYTJLRXu6LD/JACn3Qwu6hM/XRX1c9yvjmQ==}
|
||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -5933,7 +5936,7 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/bundle-utils': 7.0.0
|
'@intlify/bundle-utils': 7.0.0
|
||||||
'@intlify/shared': 9.3.0-beta.21
|
'@intlify/shared': 9.3.0-beta.24
|
||||||
'@rollup/pluginutils': 4.2.1
|
'@rollup/pluginutils': 4.2.1
|
||||||
debug: 4.3.4(supports-color@9.2.2)
|
debug: 4.3.4(supports-color@9.2.2)
|
||||||
fast-glob: 3.2.11
|
fast-glob: 3.2.11
|
||||||
@@ -5960,7 +5963,7 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/bundle-utils': 3.4.0(vue-i18n@9.2.2)
|
'@intlify/bundle-utils': 3.4.0(vue-i18n@9.2.2)
|
||||||
'@intlify/shared': 9.3.0-beta.21
|
'@intlify/shared': 9.3.0-beta.24
|
||||||
'@rollup/pluginutils': 4.2.1
|
'@rollup/pluginutils': 4.2.1
|
||||||
debug: 4.3.4(supports-color@9.2.2)
|
debug: 4.3.4(supports-color@9.2.2)
|
||||||
fast-glob: 3.2.12
|
fast-glob: 3.2.12
|
||||||
@@ -5988,7 +5991,7 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/bundle-utils': 3.4.0(vue-i18n@9.2.2)
|
'@intlify/bundle-utils': 3.4.0(vue-i18n@9.2.2)
|
||||||
'@intlify/shared': 9.3.0-beta.21
|
'@intlify/shared': 9.3.0-beta.24
|
||||||
'@rollup/pluginutils': 4.2.1
|
'@rollup/pluginutils': 4.2.1
|
||||||
debug: 4.3.4(supports-color@9.2.2)
|
debug: 4.3.4(supports-color@9.2.2)
|
||||||
fast-glob: 3.2.12
|
fast-glob: 3.2.12
|
||||||
@@ -17042,6 +17045,10 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
yallist: 4.0.0
|
yallist: 4.0.0
|
||||||
|
|
||||||
|
/minisearch@6.1.0:
|
||||||
|
resolution: {integrity: sha512-PNxA/X8pWk+TiqPbsoIYH0GQ5Di7m6326/lwU/S4mlo4wGQddIcf/V//1f9TB0V4j59b57b+HZxt8h3iMROGvg==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/minizlib@2.1.2:
|
/minizlib@2.1.2:
|
||||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
|
|||||||
Reference in New Issue
Block a user