Closed Red-Asuka closed 2 years ago
when i mouse leave and keyup enter ,focusIndex = -1,this.suggestions[i].external is undefined, it can not jump.
focusIndex = -1
this.suggestions[i].external
unfocus() { this.focusIndex = -1 }, showSuggestions() { return this.focused && this.suggestions && this.suggestions.length }, go(i) { if (!this.showSuggestions) { return } if (hooks.onGoToSuggestion) { const result = hooks.onGoToSuggestion(i, this.suggestions[i], this.query, this.queryTerms) if (result === true) return } if (this.suggestions[i].external) { window.open(this.suggestions[i].path + this.suggestions[i].slug, '_blank') } else { this.$router.push(this.suggestions[i].path + this.suggestions[i].slug) this.query = '' this.focusIndex = 0 this.focused = false // reset query param const params = this.urlParams() if (params) { params.delete('query') const paramsString = params.toString() const newState = window.location.pathname + (paramsString ? `?${paramsString}` : '') history.pushState(null, '', newState) } } },
when i use keyup enter to jump, this.focused = false, but cursor is still focused, change query, it can not show Suggestions,because this.focused = false,showSuggestions = false,I don’t think there should be this.focused = false
this.focused = false
showSuggestions = false
when i mouse leave and keyup enter ,
focusIndex = -1
,this.suggestions[i].external
is undefined, it can not jump.when i use keyup enter to jump,
this.focused = false
, but cursor is still focused, change query, it can not show Suggestions,becausethis.focused = false
,showSuggestions = false
,I don’t think there should bethis.focused = false