fix(search): show escape to close on footer

pull/2229/head
Divyansh Singh 2 years ago
parent 4fd40d5f62
commit 6d5b4cd784

@ -286,7 +286,9 @@ const defaultTranslations: { modal: ModalTranslations } = {
selectKeyAriaLabel: 'enter', selectKeyAriaLabel: 'enter',
navigateText: 'to navigate', navigateText: 'to navigate',
navigateUpKeyAriaLabel: 'up arrow', navigateUpKeyAriaLabel: 'up arrow',
navigateDownKeyAriaLabel: 'down arrow' navigateDownKeyAriaLabel: 'down arrow',
closeText: 'to close',
closeKeyAriaLabel: 'escape'
} }
} }
} }
@ -313,7 +315,13 @@ useEventListener('popstate', (event) => {
<div class="shell"> <div class="shell">
<div class="search-bar" @pointerup="onSearchBarClick($event)"> <div class="search-bar" @pointerup="onSearchBarClick($event)">
<svg class="search-icon" width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"> <svg
class="search-icon"
width="18"
height="18"
viewBox="0 0 24 24"
aria-hidden="true"
>
<g <g
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
@ -331,7 +339,12 @@ useEventListener('popstate', (event) => {
:title="$t('modal.backButtonTitle')" :title="$t('modal.backButtonTitle')"
@click="$emit('close')" @click="$emit('close')"
> >
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"> <svg
width="18"
height="18"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path <path
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
@ -358,7 +371,12 @@ useEventListener('popstate', (event) => {
:title="$t('modal.displayDetails')" :title="$t('modal.displayDetails')"
@click="showDetailedList = !showDetailedList" @click="showDetailedList = !showDetailedList"
> >
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"> <svg
width="18"
height="18"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path <path
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
@ -375,7 +393,12 @@ useEventListener('popstate', (event) => {
:title="$t('modal.resetButtonTitle')" :title="$t('modal.resetButtonTitle')"
@click="filterText = ''" @click="filterText = ''"
> >
<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"> <svg
width="18"
height="18"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path <path
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
@ -398,7 +421,7 @@ useEventListener('popstate', (event) => {
:class="{ :class="{
selected: selectedIndex === index selected: selectedIndex === index
}" }"
:aria-title="[...p.titles, p.title].join(' > ')" :aria-label="[...p.titles, p.title].join(' > ')"
@mouseenter="!disableMouseOver && (selectedIndex = index)" @mouseenter="!disableMouseOver && (selectedIndex = index)"
@click="$emit('close')" @click="$emit('close')"
> >
@ -444,7 +467,7 @@ useEventListener('popstate', (event) => {
<div class="search-keyboard-shortcuts"> <div class="search-keyboard-shortcuts">
<span> <span>
<kbd :aria-title="$t('modal.footer.navigateUpKeyAriaLabel')"> <kbd :aria-label="$t('modal.footer.navigateUpKeyAriaLabel')">
<svg width="14" height="14" viewBox="0 0 24 24"> <svg width="14" height="14" viewBox="0 0 24 24">
<path <path
fill="none" fill="none"
@ -456,8 +479,7 @@ useEventListener('popstate', (event) => {
/> />
</svg> </svg>
</kbd> </kbd>
{{ ' ' }} <kbd :aria-label="$t('modal.footer.navigateDownKeyAriaLabel')">
<kbd :aria-title="$t('modal.footer.navigateDownKeyAriaLabel')">
<svg width="14" height="14" viewBox="0 0 24 24"> <svg width="14" height="14" viewBox="0 0 24 24">
<path <path
fill="none" fill="none"
@ -472,8 +494,8 @@ useEventListener('popstate', (event) => {
{{ $t('modal.footer.navigateText') }} {{ $t('modal.footer.navigateText') }}
</span> </span>
<span> <span>
<kbd :aria-title="$t('modal.footer.selectKeyAriaLabel')" <kbd :aria-label="$t('modal.footer.selectKeyAriaLabel')">
><svg width="14" height="14" viewBox="0 0 24 24"> <svg width="14" height="14" viewBox="0 0 24 24">
<g <g
fill="none" fill="none"
stroke="currentcolor" stroke="currentcolor"
@ -488,6 +510,10 @@ useEventListener('popstate', (event) => {
</kbd> </kbd>
{{ $t('modal.footer.selectText') }} {{ $t('modal.footer.selectText') }}
</span> </span>
<span>
<kbd :aria-label="$t('modal.footer.closeKeyAriaLabel')">esc</kbd>
{{ $t('modal.footer.closeText') }}
</span>
</div> </div>
</div> </div>
</div> </div>
@ -601,6 +627,13 @@ useEventListener('popstate', (event) => {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 16px; gap: 16px;
line-height: 14px;
}
.search-keyboard-shortcuts span {
display: flex;
align-items: center;
gap: 4px;
} }
@media (max-width: 768px) { @media (max-width: 768px) {

@ -22,4 +22,6 @@ interface FooterTranslations {
navigateText?: string navigateText?: string
navigateUpKeyAriaLabel?: string navigateUpKeyAriaLabel?: string
navigateDownKeyAriaLabel?: string navigateDownKeyAriaLabel?: string
closeText?: string
closeKeyAriaLabel?: string
} }

Loading…
Cancel
Save