From 6d5b4cd784274786ad57cef378646320ba17faf1 Mon Sep 17 00:00:00 2001
From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
Date: Sun, 16 Apr 2023 13:10:38 +0530
Subject: [PATCH] fix(search): show escape to close on footer
---
.../components/VPLocalSearchBox.vue | 55 +++++++++++++++----
types/local-search.d.ts | 2 +
2 files changed, 46 insertions(+), 11 deletions(-)
diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue
index 35749649..d0743db2 100644
--- a/src/client/theme-default/components/VPLocalSearchBox.vue
+++ b/src/client/theme-default/components/VPLocalSearchBox.vue
@@ -286,7 +286,9 @@ const defaultTranslations: { modal: ModalTranslations } = {
selectKeyAriaLabel: 'enter',
navigateText: 'to navigate',
navigateUpKeyAriaLabel: 'up arrow',
- navigateDownKeyAriaLabel: 'down arrow'
+ navigateDownKeyAriaLabel: 'down arrow',
+ closeText: 'to close',
+ closeKeyAriaLabel: 'escape'
}
}
}
@@ -313,7 +315,13 @@ useEventListener('popstate', (event) => {
-
@@ -601,6 +627,13 @@ useEventListener('popstate', (event) => {
display: flex;
flex-wrap: wrap;
gap: 16px;
+ line-height: 14px;
+}
+
+.search-keyboard-shortcuts span {
+ display: flex;
+ align-items: center;
+ gap: 4px;
}
@media (max-width: 768px) {
diff --git a/types/local-search.d.ts b/types/local-search.d.ts
index c0afa557..fa7a2890 100644
--- a/types/local-search.d.ts
+++ b/types/local-search.d.ts
@@ -22,4 +22,6 @@ interface FooterTranslations {
navigateText?: string
navigateUpKeyAriaLabel?: string
navigateDownKeyAriaLabel?: string
+ closeText?: string
+ closeKeyAriaLabel?: string
}