Skip to content

Commit

Permalink
static/frontend: made cancel button in search field keyboard accessible
Browse files Browse the repository at this point in the history
https://screenshot.googleplex.com/p4zQ4YTuUYnfAjg.png

Change-Id: Idb1d198ba1c7cdac041b77b2f81d2bb9a2368156
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/513037
Reviewed-by: Alice Merrick <[email protected]>
kokoro-CI: kokoro <[email protected]>
Reviewed-by: Jamal Carvalho <[email protected]>
Reviewed-by: Prudhvi Krishna Chintala <[email protected]>
Run-TryBot: Jamal Carvalho <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
prudhvikrishna authored and jamalc committed Aug 24, 2023
1 parent 15c6f93 commit a224e84
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 5 deletions.
28 changes: 28 additions & 0 deletions static/frontend/homepage/homepage.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,34 @@
}
}

.Homepage-closeIcon {
background: var(--color-input);
border-bottom: var(--border);
border-color: var(--color-brand-primary);
border-left: 0;
border-top: var(--border);
color: var(--color-button);
cursor: pointer;
display: inline-block;
font-weight: bold;
padding-left: 0.5rem;
padding-right: 0.5rem;
}

.Homepage-closeIcon:hover,
.Homepage-closeIcon:focus,
.Homepage-closeIcon:focus-within,
.Homepage-closeIcon:active {
border-left: 0 !important;
}

.Homepage-search--input:hover,
.Homepage-search--input:focus,
.Homepage-search--input:focus-within,
.Homepage-search--input:active {
border-right: 0 !important;
}

input[type='search']::-webkit-search-decoration {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion static/frontend/homepage/homepage.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/frontend/homepage/homepage.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/frontend/homepage/homepage.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
<form class="go-InputGroup Homepage-search Homepage-search--symbol"
action="/search" role="search" data-gtmc="homepage search form">
<input
class="go-Input js-searchFocus"
class="go-Input js-searchFocus Homepage-search--input"
data-test-id="homepage-search"
id="AutoComplete"
role="textbox"
aria-label="{{.SearchPrompt}}"
type="search"
name="q"
placeholder="{{.SearchPrompt}}"
autocapitalize="off"
Expand All @@ -30,6 +29,7 @@
spellcheck="false"
title="{{.SearchPrompt}}"
autofocus="true">
<button class="Homepage-closeIcon" type="reset" aria-label="Clear Search"> X </button>
<button type="submit" class="go-Button">Search</button>
</form>
<section class="go-Carousel Homepage-tips js-carousel" aria-label="Search Tips Carousel" data-slide-index="{{.TipIndex}}">
Expand Down
Binary file modified tests/screentest/testdata/ci/vuln-nonstdlib-module-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-nonstdlib-module.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/home-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/home.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a224e84

Please sign in to comment.