Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Add a Tab handler on the Search button
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb committed Oct 10, 2022
1 parent c203022 commit f6d01f6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/VHeader/VSearchBar/VSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
<!-- @slot Extra information such as loading message or result count goes here. -->
<slot />
</VInputField>
<VSearchButton type="submit" :size="size" :route="route" />
<VSearchButton
type="submit"
:size="size"
:route="route"
@keydown.tab="handleSearchBlur"
/>
</form>
<VRecentSearches
v-show="isNewHeaderEnabled && isRecentVisible"
Expand Down Expand Up @@ -135,6 +140,9 @@ export default defineComponent({
const handleBlur = () => {
isRecentVisible.value = false
}
const handleSearchBlur = () => {
if (!entries.value.length) handleBlur()
}
onClickOutside(searchBarEl, handleBlur)
/* Recent searches */
Expand Down Expand Up @@ -231,6 +239,7 @@ export default defineComponent({
handleFocus,
handleBlur,
handleSearchBlur,
isNewHeaderEnabled,
isRecentVisible,
Expand Down

0 comments on commit f6d01f6

Please sign in to comment.