Skip to content

Commit

Permalink
fix(a11y): fix tab order reset in the header (#9851)
Browse files Browse the repository at this point in the history
fix(tab): fix tab order reset in the header

When tabbing through the header reaching the search input and
pressing tab again will reset the focus to the html document.

This happened because the next item would be the cancel input
button. Which will be removed via display one and then we start
from the the beginning.
  • Loading branch information
fiji-flo authored Oct 24, 2023
1 parent a35c689 commit b12f554
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions client/src/ui/molecules/search/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
}
}

.search-widget:focus-within .search-input-field,
.search-input-field:focus,
.search-input-field:valid {
width: inherit;

/* When the search input has focus or has content,
show the clear search button */
~ .button.clear-search-button {
display: block;
right: 2.8rem;
}
}

.search-input-field {
// make webkit play nice with search input types
-webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
Expand Down Expand Up @@ -48,18 +61,6 @@
}
}

&:focus,
&:valid {
width: inherit;

/* When the search input has focus or has content,
show the clear search button */
~ .button.clear-search-button {
display: block;
right: 2.8rem;
}
}

&:invalid,
&:invalid::placeholder {
animation: blink 2s step-end infinite;
Expand Down

0 comments on commit b12f554

Please sign in to comment.